パッケージの詳細

is-weakmap

inspect-js119.3mMIT2.0.2

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

map, weakmap, set, weakset

readme

is-weakmap Version Badge

github actions coverage License Downloads

npm badge

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

Example

var isWeakMap = require('is-weakmap');
assert(!isWeakMap(function () {}));
assert(!isWeakMap(null));
assert(!isWeakMap(function* () { yield 42; return Infinity; });
assert(!isWeakMap(Symbol('foo')));
assert(!isWeakMap(1n));
assert(!isWeakMap(Object(1n)));

assert(!isWeakMap(new Set()));
assert(!isWeakMap(new WeakSet()));
assert(!isWeakMap(new Map()));

assert(isWeakMap(new WeakMap()));

class MyWeakMap extends WeakMap {}
assert(isWeakMap(new MyWeakMap()));

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.2 - 2024-03-08

Commits

  • [actions] reuse common workflows 0af1292
  • [Tests] migrate tests to Github Actions f35679b
  • [actions] use node/install instead of node/run; use codecov action cd2f0fa
  • add types 6e28e6a
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, es6-shim, object-inspect, tape 95815ce
  • [readme] update URLs 2c4eb0b
  • [Tests] run nyc on all tests; use tape runner 0a45b37
  • [Dev Deps] update eslint, @ljharb/eslint-config, object-inspect, safe-publish-latest, tape ffe9459
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, es5-shim, object-inspect, tape c3c2f11
  • [actions] remove redundant finisher afa4018
  • [Dev Deps] update eslint, @ljharb/eslint-config, auto-changelog, core-js, es5-shim, object-inspect, safe-publish-latest, tape 3f22fc1
  • [Dev Deps] update @ljharb/eslint-config, aud, es6-shim, npmignore, object-inspect, tape 84ba754
  • [actions] update rebase action to use reusable workflow def85cb
  • [actions] update codecov uploader 659031e
  • [actions] add "Allow Edits" workflow a916e89
  • [readme] remove travis badge 01d0c7d
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, object-inspect, tape ad90d06
  • [meta] use npmignore to autogenerate an npmignore file 8b0b44f
  • [Dev Deps] update eslint, @ljharb/eslint-config, es5-shim, tape 9d8a683
  • [Tests] add core-js tests 8ba8d2b
  • [readme] add actions and codecov badges 49769ce
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 377dfac
  • [actions] switch Automatic Rease workflow to pull_request_target event 00f8c17
  • [Dev Deps] update es5-shim, tape 3a82ee8
  • [meta] add missing engines.node 3671b4f
  • [meta] use prepublishOnly script for npm 7+ 2a5d5ea
  • [Dev Deps] update auto-changelog; add aud 595583b
  • [readme] remove dead badges 4d6cb2c
  • [Tests] run all tests on npm test 9da2487
  • [Tests] only audit prod deps 2f9281a
  • [meta] add sideEffects flag b9c8797

v2.0.1 - 2019-12-17

Fixed

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

Commits

  • [actions] add automatic rebasing / merge commit blocking 4fa3010
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 44bafb6

v2.0.0 - 2019-11-12

Commits

v1.0.1 - 2015-08-31

Commits

v1.0.0 - 2015-02-18

Commits