A collection of utility functions for data validation and date formatting. |
---|
You can install this package in your project using npm
:
npm install ertu-js-utils
const { isNull } = require('ertu-js-utils');
console.log(isNull(null)); // true
console.log(isNull(5)); // false
const { formatCreatedAt } = require('ertu-js-utils');
const date = '2023-10-17T12:34:56Z';
console.log(formatCreatedAt(date, 'en-US', true)); // 10/17/2023, 12:34 PM GMT
console.log(formatCreatedAt(date, 'tr-TR'));
const { isNumber } = require('ertu-js-utils');
console.log(isNumber(123)); // true
console.log(isNumber("456")); // true
console.log(isNumber("456a")); // false
console.log(isNumber("abc")); // false
console.log(isNumber(null)); // false
MIT