UNPKG

449 BJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5/**
6 *
7 * @type {Function|function(*):string}
8 */
9const protoType = Function.prototype.call.bind(Object.prototype.toString);
10/**
11 * const rxObj = /^\[object (.*)]$/
12 * Equivalent to: Object.prototype.stringify.call(o).match(rxObj)[1]
13 * @param {*} o
14 * @return {string}
15 */
16
17const typ = o => protoType(o).slice(8, -1);
18
19exports.protoType = protoType;
20exports.typ = typ;