frontend/.pnpm-store/v3/files/99/8117b5724326a0bbb929fbe2320067044250519d16796bc46545916e16c74318df1b049cf1e522f70ba399a30f96631c0aeae65e54d72d97fcb12c668c2b53

10 lines
313 B
Plaintext

/**
* Better way to handle type checking
* null, {}, array and date are objects, which confuses
*/
export default function typeOf(input) {
var rawObject = Object.prototype.toString.call(input).toLowerCase();
var typeOfRegex = /\[object (.*)]/g;
var type = typeOfRegex.exec(rawObject)[1];
return type;
}