Big update!Introducing GitHub Bot Commands. Learn more
Socket
BlogLoveLog in
Book a demo

internal-slot

Package Overview
Dependencies
3
Maintainers
1
Versions
4
Issues
File Explorer

Advanced tools

internal-slot

ES spec-like internal slots

    1.0.3latest

Version published
Maintainers
1
Weekly downloads
23,125,883
increased by3.98%

Weekly downloads

Changelog

Source

v1.0.3

26 January 2021

Readme

Source

internal-slot Version Badge

dependency status dev dependency status License Downloads

npm badge

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.

Example

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'); });

Tests

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

Security

Please email @ljharb or see https://tidelift.com/security if you have a potential security vulnerability to report.

Keywords

FAQs

What is internal-slot?

ES spec-like internal slots

Is internal-slot popular?

The npm package internal-slot receives a total of 22,154,139 weekly downloads. As such, internal-slot popularity was classified as popular.

Is internal-slot well maintained?

We found that internal-slot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 26 Jan 2021
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc