htc 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
..
.github 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
test 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
.eslintrc 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
.nycrc 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
CHANGELOG.md 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
LICENSE 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
README.md 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
index.d.ts 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
index.js 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
package.json 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred
tsconfig.json 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesiacov pred

README.md

is-weakref Version Badge

github actions coverage dependency status dev dependency status License Downloads

[![npm badge][11]][1]

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

Example

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

assert(!isWeakRef(new Set()));
assert(!isWeakRef(new WeakSet()));
assert(!isWeakRef(new Map()));
assert(!isWeakRef(new WeakMap()));

assert(isWeakRef(new WeakRef({})));

class MyWeakRef extends WeakRef {}
assert(isWeakRef(new MyWeakRef({})));

Tests

Simply clone the repo, npm install, and run npm test