mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
wip: migrate to bun
This commit is contained in:
27
src/isSet.ts
Normal file
27
src/isSet.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import getTag from './.internal/getTag.js';
|
||||
import nodeTypes from './.internal/nodeTypes.js';
|
||||
import isObjectLike from './isObjectLike.js';
|
||||
|
||||
/* Node.js helper references. */
|
||||
const nodeIsSet = nodeTypes && nodeTypes.isSet;
|
||||
|
||||
/**
|
||||
* Checks if `value` is classified as a `Set` object.
|
||||
*
|
||||
* @since 4.3.0
|
||||
* @category Lang
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
|
||||
* @example
|
||||
*
|
||||
* isSet(new Set)
|
||||
* // => true
|
||||
*
|
||||
* isSet(new WeakSet)
|
||||
* // => false
|
||||
*/
|
||||
const isSet = nodeIsSet
|
||||
? (value) => nodeIsSet(value)
|
||||
: (value) => isObjectLike(value) && getTag(value) == '[object Set]';
|
||||
|
||||
export default isSet;
|
||||
Reference in New Issue
Block a user