@tomei/finance
Version:
NestJS package for finance module
29 lines • 870 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.type = type;
function type(value) {
if (value === null) {
return 'null';
}
const baseType = typeof value;
if (!['object', 'function'].includes(baseType)) {
return baseType;
}
if (baseType === 'object' && value.ObjectType) {
return value.ObjectType;
}
const tag = value[Symbol.toStringTag];
if (typeof tag === 'string') {
return tag;
}
if (baseType === 'function' &&
Function.prototype.toString.call(value).startsWith('class')) {
return Function.prototype.toString.call(value).split(' ')[1];
}
const className = value.constructor.name;
if (typeof className === 'string' && className !== '') {
return className;
}
return baseType;
}
//# sourceMappingURL=typeof.js.map