simple2k13
Version:
some simple functions
11 lines • 370 B
JavaScript
const dataType = (data, options) => {
const result = (typeof data);
const { lowercase = false } = options || {};
if (result === 'object') {
const result = Object.prototype.toString.call(data).slice(8, -1);
return lowercase ? result.toLowerCase() : result;
}
return result;
};
export default dataType;
//# sourceMappingURL=index.js.map