es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
15 lines (14 loc) • 402 B
JavaScript
//#region src/compat/_internal/getTag.ts
/**
* Gets the `toStringTag` of `value`.
*
* @private
* @param {T} value The value to query.
* @returns {string} Returns the `Object.prototype.toString.call` result.
*/
function getTag(value) {
if (value == null) return value === void 0 ? "[object Undefined]" : "[object Null]";
return Object.prototype.toString.call(value);
}
//#endregion
export { getTag };