UNPKG

@minimaltech/ra-infra

Version:

Minimal Technology ReactJS Infrastructure

26 lines 826 B
export const isDefined = (value) => { return value !== undefined && value !== null; }; export const isString = (value) => { return typeof value === 'string'; }; export const isNumber = (value, exact) => { if (exact) { return typeof value === 'number'; } if (typeof value !== 'string' && typeof value !== 'number') { return false; } return !isNaN(parseFloat(String(value))) && isFinite(Number(value)); }; export const isObject = (value) => { return typeof value === 'object' && value !== null && !Array.isArray(value); }; export const isBrowser = () => { return typeof window !== 'undefined'; }; export const isValidDate = (value) => { const date = new Date(value); return date instanceof Date && !isNaN(date.valueOf()); }; //# sourceMappingURL=boolean.utility.js.map