UNPKG

@beenotung/tslib

Version:
15 lines (14 loc) 408 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getObjectType = getObjectType; 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(/]$/, ''); }