UNPKG

@xtsai/xai-utils

Version:

The xai-utils is an openai nodejs sdk compatible extension library.

26 lines 960 B
export function isNumber(value) { return Object.prototype.toString.call(value) === '[object Number]'; } export function isString(value) { return Object.prototype.toString.call(value) === '[object String]'; } export function isNotEmptyString(value) { return typeof value === 'string' && value.length > 0; } export function isBoolean(value) { return Object.prototype.toString.call(value) === '[object Boolean]'; } export function isFunction(value) { return Object.prototype.toString.call(value) === '[object Function]'; } export const isInvalidDate = (d) => { if (typeof d === 'undefined') return true; if (new Date(d).toString() === 'Invalid Date') return true; return false; }; const CNF_PROP_VOLUME_YES = ['1', 1, 'on', 'y', 'yes', 'true', true]; export const isConfigYes = (v) => CNF_PROP_VOLUME_YES.includes(v) || CNF_PROP_VOLUME_YES.includes(String(v).toLocaleLowerCase()); //# sourceMappingURL=is.js.map