is-map (2.0.3)
Published 2026-02-24 13:58:28 +00:00 by atheaadmin
Installation
registry=npm install is-map@2.0.3"is-map": "2.0.3"About this package
is-map 
Is this value a JS Map? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
Example
var isMap = require('is-map');
assert(!isMap(function () {}));
assert(!isMap(null));
assert(!isMap(function* () { yield 42; return Infinity; });
assert(!isMap(Symbol('foo')));
assert(!isMap(1n));
assert(!isMap(Object(1n)));
assert(!isMap(new Set()));
assert(!isMap(new WeakSet()));
assert(!isMap(new WeakMap()));
assert(isMap(new Map()));
class MyMap extends Map {}
assert(isMap(new MyMap()));
Tests
Simply clone the repo, npm install, and run npm test
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| @arethetypeswrong/cli | ^0.15.0 |
| @ljharb/eslint-config | ^21.1.0 |
| @types/for-each | ^0.3.3 |
| @types/object-inspect | ^1.8.4 |
| @types/tape | ^5.6.4 |
| aud | ^2.0.4 |
| auto-changelog | ^2.4.0 |
| core-js | ^2.6.12 |
| es5-shim | ^4.6.7 |
| es6-shim | ^0.35.8 |
| eslint | =8.8.0 |
| for-each | ^0.3.3 |
| in-publish | ^2.0.1 |
| npmignore | ^0.3.1 |
| nyc | ^10.3.2 |
| object-inspect | ^1.13.1 |
| safe-publish-latest | ^2.0.0 |
| tape | ^5.7.5 |
| typescript | ^5.5.0-dev.20240308 |
Keywords
map
set
collection
is
robust
