is-map <sup>Version Badge</sup>

github actions coverage dependency status dev dependency status License Downloads

npm badge

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

is-map - Installation

To install is-map via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install is-map --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install is-map

Learn more about the config option.

PNPM

pnpm install is-map --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install is-map --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

is-map - Download

Download Tarball (v2.0.3)

Integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==
SHASUM ede96b7fe1e270b3c4465e3a465658764926d62e
Tarball https://js.registry.sudovanilla.org/is-map/-/is-map-2.0.3.tgz