UNPKG

decode-it

Version:

a simple zero-dependency type safe json decoder for typescript

23 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isFunction = exports.isUndefined = exports.isEmptyArray = exports.isArray = exports.isNull = exports.isBoolean = exports.isNumber = exports.isObject = exports.isString = void 0; require("./helperTypes"); const isString = (arg) => typeof arg === 'string'; exports.isString = isString; const isObject = (arg) => typeof arg === 'object' && !Array.isArray(arg) && arg !== null; exports.isObject = isObject; const isNumber = (arg) => typeof arg === 'number'; exports.isNumber = isNumber; const isBoolean = (arg) => typeof arg === 'boolean'; exports.isBoolean = isBoolean; const isNull = (arg) => arg === null; exports.isNull = isNull; const isArray = (arg) => Array.isArray(arg); exports.isArray = isArray; const isEmptyArray = (arg) => arg.length === 0; exports.isEmptyArray = isEmptyArray; const isUndefined = (arg) => arg === undefined; exports.isUndefined = isUndefined; const isFunction = (arg) => typeof arg === 'function'; exports.isFunction = isFunction; //# sourceMappingURL=typeCheckers.js.map