UNPKG

347 BJavaScriptView Raw
1/**
2 *
3 * @type {Function|function(*):string}
4 */
5const protoType = Function.prototype.call.bind(Object.prototype.toString);
6/**
7 * const rxObj = /^\[object (.*)]$/
8 * Equivalent to: Object.prototype.stringify.call(o).match(rxObj)[1]
9 * @param {*} o
10 * @return {string}
11 */
12
13const typ = o => protoType(o).slice(8, -1);
14
15export { protoType, typ };