UNPKG

518 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8/**
9 * Returns a string with the data type from given value.
10 * @example
11 * typeOf('hello'); // output: string
12 * typeOf(function() {}); // output: function
13 * typeOf(new Date()); // output: date
14 * @param value
15 * @return {string}
16 */
17var typeOf = function typeOf(value) {
18 return {}.toString.call(value).match(/\s([A-Za-z]+)/)[1].toLowerCase();
19};
20
21var _default = typeOf;
22exports.default = _default;
\No newline at end of file