ts-cast
Version:
Runtime typechecking
28 lines (27 loc) • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isBool = exports.isATuple = exports.isAnObj = exports.isStr = exports.isInt = exports.isNumber = exports.isNotEmpty = exports.isEmpty = void 0;
var isEmpty = function (value) { return value == null; };
exports.isEmpty = isEmpty;
var isNotEmpty = function (value) { return value != null; };
exports.isNotEmpty = isNotEmpty;
var isNumber = function (value) { return typeof value === 'number'; };
exports.isNumber = isNumber;
var isInt = function (value) {
return typeof value === 'number' && Number.isInteger(value);
};
exports.isInt = isInt;
var isStr = function (value) { return typeof value === 'string'; };
exports.isStr = isStr;
var isAnObj = function (value) {
return typeof value === 'object' && value !== null && !Array.isArray(value);
};
exports.isAnObj = isAnObj;
var isATuple = function (value) {
return Array.isArray(value);
};
exports.isATuple = isATuple;
var isBool = function (value) {
return typeof value === 'boolean';
};
exports.isBool = isBool;