Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
internal-slot
Advanced tools
Truly private storage, akin to the JS spec’s concept of internal slots.
Uses a WeakMap when available; a Map when not; and a regular object in even older engines. Performance and garbage collection behavior will reflect the environment’s capabilities accordingly.
var SLOT = require('internal-slot');
var assert = require('assert');
var o = {};
assert.throws(function () { SLOT.assert(o, 'foo'); });
assert.equal(SLOT.has(o, 'foo'), false);
assert.equal(SLOT.get(o, 'foo'), undefined);
SLOT.set(o, 'foo', 42);
assert.equal(SLOT.has(o, 'foo'), true);
assert.equal(SLOT.get(o, 'foo'), 42);
assert.doesNotThrow(function () { SLOT.assert(o, 'foo'); });
Simply clone the repo, npm install
, and run npm test
Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.
26 January 2021
0ef2263
6253915
ef94e55
nyc
on all tests; use tape
runner 917d6ca
eslint
, @ljharb/eslint-config
, aud
, auto-changelog
, object-inspect
, tape
8dcb6fe
7aa3e86
get-intrinsic
instead of es-abstract
; update side-channel
11ad17d
5b75452
pull_request_target
event d531688
@ljharb/eslint-config
, tape
c76fa91
eslint
, tape
e733ccd
auto-changelog
; add aud
df20bf5
e89e6f1
71317b9
es-abstract
c17ccf4
tape
d81ae03
es-abstract
b56303b
es-abstract
9996d1c
FAQs
ES spec-like internal slots
The npm package internal-slot receives a total of 27,566,714 weekly downloads. As such, internal-slot popularity was classified as popular.
We found that internal-slot demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.