@beenotung/tslib
Version:
utils library in Typescript
16 lines • 472 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getObjectType = void 0;
function getObjectType(o) {
const type = Object.prototype.toString.call(o);
const match = type.match(/^\[object (.*)]$/);
if (match) {
const res = match[1];
if (res) {
return res;
}
}
return type.replace(/^\[/, '').replace(/]$/, '');
}
exports.getObjectType = getObjectType;
//# sourceMappingURL=type.js.map