agsamantha/node_modules/langsmith/dist/utils/lodash/isSymbol.js

24 lines
578 B
JavaScript
Raw Normal View History

2024-10-02 15:15:21 -05:00
// @ts-nocheck
import getTag from "./getTag.js";
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* isSymbol(Symbol.iterator)
* // => true
*
* isSymbol('abc')
* // => false
*/
function isSymbol(value) {
const type = typeof value;
return (type === "symbol" ||
(type === "object" && value != null && getTag(value) === "[object Symbol]"));
}
export default isSymbol;