@zerodep/is-set
v2.0.11
Published
A utility to determine if a value is a Set
Downloads
6
Readme
@zerodep/is-set
A simple, performant utility to determine if a value is a Set.
Full documentation is available at the zerodep.app page.
Examples
All @zerodep packages support both ESM and CJS.
import { isSet } from '@zerodep/is-set';
// or
const { isSet } = require('@zerodep/is-set');
Positive Response
isSet(new Set()); // true
isSet(new Set([1, 2, 3])); // true
Negative Response
isSet(['a', 'b', 'c']); // false
isSet(1000n); // false
isSet(true); // false
isSet(new Date()); // false
isSet(''); // false
isSet(new Error('message')); // false
isSet(3.14); // false
isSet(() => 'function'); // false
isSet(42); // false
isSet(
new Map([
['a', 1],
['b', 2],
])
); // false
isSet(null); // false
isSet({ an: 'object' }); // false
isSet(new Promise(() => {})); // false
isSet(/[regex]+/gi); // false
isSet('a string'); // false
isSet(Symbol()); // false
isSet(new Int32Array(2)); // false
isSet(undefined); // false