包详细信息

is-map

inspect-js122.4mMIT2.0.3

Is this value a JS Map? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

map, set, collection, is

自述文件

is-map Version Badge

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

更新日志

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v2.0.3 - 2024-03-08

Commits

  • [actions] reuse common workflows ce10d0f
  • [meta] use npmignore to autogenerate an npmignore file e07e23a
  • add types cd13cfb
  • [actions] use node/install instead of node/run; use codecov action 1e055f9
  • [Dev Deps] update eslint, @ljharb/eslint-config, object-inspect, safe-publish-latest, tape 12d125e
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, es5-shim, object-inspect, tape adfb18e
  • [actions] remove redundant finisher c5511b7
  • [Dev Deps] update @ljharb/eslint-config, aud, es6-shim, npmignore, object-inspect, tape b2c7d67
  • [actions] update rebase action to use reusable workflow bbad644
  • [actions] update codecov uploader 8f57f98
  • [Dev Deps] update eslint, @ljharb/eslint-config, auto-changelog, es5-shim, object-inspect, tape d330ff4
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, object-inspect, tape 454e31c
  • [Dev Deps] update eslint, @ljharb/eslint-config, es5-shim, tape b43283d
  • [readme] add actions and codecov badges 0fc119e
  • [Dev Deps] update eslint, object-inspect e2311f8
  • [meta] add missing engines.node 9bddaf2
  • [meta] use prepublishOnly script for npm 7+ d3b7661
  • [Dev Deps] update safe-publish-latest 00d7b69
  • [meta] add sideEffects flag bab4457

v2.0.2 - 2020-12-13

Commits

  • [Tests] migrate tests to Github Actions 349a036
  • [meta] do not publish github action workflow files f473ae7
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, es6-shim, object-inspect, tape 12dbda3
  • [Tests] run nyc on all tests; use tape runner; add core-js tests b280737
  • [actions] add "Allow Edits" workflow d8dcf17
  • [readme] remove travis badge eab86f9
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 9c87af5
  • [actions] switch Automatic Rease workflow to pull_request_tarbget event 71647b8
  • [Dev Deps] update es5-shim, tape 3a91230
  • [Dev Deps] update auto-changelog; add aud d3cd3da
  • [Tests] only audit prod deps 83ef327
  • [meta] normalize line endings 81a9eec

v2.0.1 - 2019-12-17

Fixed

  • [Refactor] avoid top-level return, because babel and webpack are broken #5 #4 #3 #78 #7 #12

Commits

  • [actions] add automatic rebasing / merge commit blocking 743f29f
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 8ced854

v2.0.0 - 2019-11-12

Commits

v1.0.1 - 2015-07-02

Commits

  • small tweaks 2bd7622
  • Add related section to readme 3231e74
  • Update license info in readme.md 3a03b38
  • editorconfig: indent yml using 2 spaces d724177

v1.0.0 - 2015-02-18

Commits