UNPKG

@newdash/newdash

Version:

javascript/typescript utility library

32 lines (31 loc) 845 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.isSet = void 0; const getTag_1 = __importDefault(require("./.internal/getTag")); const isObjectLike_1 = __importDefault(require("./isObjectLike")); /** * Checks if `value` is classified as a `Set` object. * * @since 5.5.0 * @category Lang * @param value The value to check. * @returns Returns `true` if `value` is a set, else `false`. * @example * * ```js * isSet(new Set) * // => true * * isSet(new WeakSet) * // => false * ``` */ function isSet(value) { return (0, isObjectLike_1.default)(value) && (0, getTag_1.default)(value) == "[object Set]"; } exports.isSet = isSet; ; exports.default = isSet;