@n3okill/utils
Version:
Many javascript helpers
15 lines • 408 B
JavaScript
import { isNull } from "./isNull";
import { isUndefined } from "./isUndefined";
/**
* Return a string with the type of the object
* @param arg
* @returns {string}
*/
export function kindOf(arg) {
return isNull(arg)
? "null"
: isUndefined(arg)
? "undefined"
: /^\[object (.*)]$/.exec(Object.prototype.toString.call(arg))[1];
}
//# sourceMappingURL=kindOf.js.map