Adds annotations to Mirador 4 implementation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
astanley dc3cc1cb13 initial commit 1 week ago
..
.github initial commit 1 week ago
test initial commit 1 week ago
.editorconfig initial commit 1 week ago
.eslintrc initial commit 1 week ago
.nycrc initial commit 1 week ago
CHANGELOG.md initial commit 1 week ago
LICENSE initial commit 1 week ago
README.md initial commit 1 week ago
index.d.ts initial commit 1 week ago
index.js initial commit 1 week ago
package.json initial commit 1 week ago
tsconfig.json initial commit 1 week ago

README.md

side-channel Version Badge

github actions coverage License Downloads

npm badge

Store information about any JS value in a side channel. Uses WeakMap if available.

Warning: in an environment that lacks WeakMap, this implementation will leak memory until you delete the key.

Getting started

npm install --save side-channel

Usage/Examples

const assert = require('assert');
const getSideChannel = require('side-channel');

const channel = getSideChannel();

const key = {};
assert.equal(channel.has(key), false);
assert.throws(() => channel.assert(key), TypeError);

channel.set(key, 42);

channel.assert(key); // does not throw
assert.equal(channel.has(key), true);
assert.equal(channel.get(key), 42);

channel.delete(key);
assert.equal(channel.has(key), false);
assert.throws(() => channel.assert(key), TypeError);

Tests

Clone the repo, npm install, and run npm test