@zerodep/is-set
TypeScript icon, indicating that this package has built-in type declarations

2.0.7 • Public • Published

@zerodep/is-set

version language types license

CodeFactor Known Vulnerabilities

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

Readme

Keywords

Package Sidebar

Install

npm i @zerodep/is-set

Homepage

zerodep.app

Weekly Downloads

0

Version

2.0.7

License

MIT

Unpacked Size

4.27 kB

Total Files

7

Last publish

Collaborators

  • cdepage