Gathering detailed insights and metrics for @zerodep/is-weakset
Gathering detailed insights and metrics for @zerodep/is-weakset
A modern library of high quality, zero-dependency, fully typed, tree-shakeable utilities, parsers, data structure factories, converters and other capabilities to help you create quality Node.js/Bun and JavaScript/TypeScript applications quickly.
npm install @zerodep/is-weakset
Typescript
Module System
Node Version
NPM Version
48.4
Supply Chain
91.3
Quality
80.5
Maintenance
100
Vulnerability
100
License
TypeScript (92.28%)
JavaScript (7.72%)
Total Downloads
1,093
Last Day
1
Last Week
6
Last Month
28
Last Year
684
6 Stars
176 Commits
3 Forks
2 Watching
4 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.12
Package Id
@zerodep/is-weakset@2.0.12
Unpacked Size
8.27 kB
Size
3.29 kB
File Count
8
NPM Version
10.7.0
Node Version
20.15.1
Publised On
27 Oct 2024
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
200%
6
Compared to previous week
Last month
833.3%
28
Compared to previous month
Last year
67.2%
684
Compared to previous year
No dependencies detected.
A simple, performant utility to determine if a value is a Weak Set.
Full documentation is available at the zerodep.app page.
1declare const isWeakSet: (value: unknown) => boolean;
All @zerodep packages support both ESM and CJS.
1import { isWeakSet } from '@zerodep/is-weakset'; 2// or 3const { isWeakSet } = require('@zerodep/is-weakset');
1// Arrays 2isWeakmap([]); // false 3isWeakmap([1, 2, 3]); // false 4isWeakmap(['a', 'b', 'c']); // false 5 6// BigInts 7isWeakmap(42n); // false 8isWeakmap(0n); // false 9isWeakmap(-0n); // false 10isWeakmap(-42n); // false 11 12// Booleans 13isWeakmap(true); // false 14isWeakmap(false); // false 15 16// Class 17isWeakmap( 18 class SomeClass { 19 constructor() {} 20 } 21); // false 22 23// Dates 24isWeakmap(new Date()); // false 25isWeakmap(new Date('1970-01-01T12:00:00.000Z')); // false 26isWeakmap(new Date('2099-12-31')); // false 27 28// Empty 29isWeakmap(null); // false 30isWeakmap(undefined); // false 31 32// Errors 33isWeakmap(new Error('message')); // false 34isWeakmap(new AggregateError([new Error('err1'), new Error('err2')], 'message')); // false 35 36// Floats 37isWeakmap(3.14); // false 38isWeakmap(0.0); // false 39isWeakmap(-0.0); // false 40isWeakmap(-3.14); // false 41isWeakmap(Math.E); // false 42isWeakmap(Math.PI); // false 43isWeakmap(Number.MIN_VALUE); // false 44 45// Functions 46isWeakmap(() => 'function'); // false 47isWeakmap(async () => 'function'); // false 48 49// Generators 50isWeakmap(function* () { 51 yield 'a'; 52}); // false 53isWeakmap(async function* () { 54 yield 'a'; 55}); // false 56 57// Maps 58isWeakmap(new Map()); // false 59isWeakmap(new Map([['key1', 123]])); // false 60isWeakmap(new Map([['key1', 'value1']])); // false 61 62// Numbers 63isWeakmap(Number.POSITIVE_INFINITY); // false 64isWeakmap(Number.MAX_SAFE_INTEGER); // false 65isWeakmap(3e8); // false 66isWeakmap(42); // false 67isWeakmap(1); // false 68isWeakmap(0); // false 69isWeakmap(-0); // false 70isWeakmap(-1); // false 71isWeakmap(-42); // false 72isWeakmap(-3e8); // false 73isWeakmap(Number.MIN_SAFE_INTEGER); // false 74isWeakmap(Number.NEGATIVE_INFINITY); // false 75isWeakmap(Number.NaN); // false 76 77// POJOs 78isWeakmap({}); // false 79isWeakmap({ key: 'string' }); // false 80isWeakmap({ key: 123 }); // false 81 82// Promise 83isWeakmap(new Promise(() => {})); // false 84isWeakmap(new Promise.all([])); // false 85isWeakmap(new Promise.allSettled([])); // false 86isWeakmap(new Promise.race([])); // false 87isWeakmap(Promise.resolve()); // false 88 89// Regular Expression 90isWeakmap(/[regex]+/gi); // false 91isWeakmap(new RegExp('d', 'gi')); // false 92 93// Sets 94isWeakmap(new Set()); // false 95isWeakmap(new Set([1, 2, 3])); // false 96isWeakmap(new Set(['a', 'b', 'c'])); // false 97 98// Strings 99isWeakmap(''); // false 100isWeakmap('a longer string'); // false 101isWeakmap('1000n'); // false 102isWeakmap('3e8'); // false 103isWeakmap('42'); // false 104isWeakmap('3.14'); // false 105isWeakmap('0'); // false 106isWeakmap('-0'); // false 107isWeakmap('-3.14'); // false 108isWeakmap('-42'); // false 109isWeakmap('-3e8'); // false 110isWeakmap('-1000n'); // false 111 112// Symbols 113isWeakmap(Symbol()); // false 114isWeakmap(Symbol('name')); // false 115 116// This 117isWeakmap(this); // false 118isWeakmap(globalThis); // false 119 120// TypedArrays 121isWeakmap(new Int8Array(2)); // false 122isWeakmap(new Int16Array(2)); // false 123isWeakmap(new Int32Array(2)); // false 124isWeakmap(new Uint8Array(2)); // false 125isWeakmap(new Uint16Array(2)); // false 126isWeakmap(new Uint32Array(2)); // false 127isWeakmap(new Uint8ClampedArray(2)); // false 128 129isWeakmap(new BigInt64Array(2)); // false 130isWeakmap(new BigUint64Array(2)); // false 131 132isWeakmap(new Float32Array(2)); // false 133isWeakmap(new Float64Array(2)); // false 134 135isWeakmap(new SharedArrayBuffer(512)); // false 136 137// WeakMap and WeakSet 138isWeakmap(new WeakMap()); // false 139isWeakmap(new WeakSet()); // true
No vulnerabilities found.
No security vulnerabilities found.