1.0.7 • Published 2 months ago

internal-slot v1.0.7

Weekly downloads
6,438,329
License
MIT
Repository
github
Last release
2 months ago

internal-slot Version Badge

github actions coverage 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.

es-abstractstring.prototype.matchallarchetype-libraryeasy-select-rnreact-native-bluetooth2killi8n-react-native-fast-imagereact-native-template-rfbaseairscanairscan-examplereact-native-esc-pos-sahaab@borisovart/atol-kkt-moduledeneme323112@ntt_app/react-native-custom-notificationreact-native-covid-sdkgql_din_modafryxiconsmutasi-bca@jttechnic/interpreter@saeon/quick-formreact-native-printer-brothersreact-native-shekhar-bridge-testcogoportutilsuncoded-connectwilscanner@khalitovadel/abstract-repository@oiti/documentoscopy-react-nativequoc-testreact-native-slider-kf@infinitebrahmanuniverse/nolb-intern@saaspe/componentsexpand-react-bridgeopea-bootstraapluminos-ui-coresklif-ui-kitsklif-api@everything-registry/sub-chunk-1921jawwy-sdkjawwy_gamification_release@deepakorg/test@deepak757/testreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgp149-tablesklif-uimachinebeemrcapsreact-native-jawwy_samplejawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwynextjs-storiestest_lib_module_aarzzzxxxyyy321123@batbayar/superset-plugin-chart-hello-world@girhan/moko@hemith/react-native-tnk@hristo2612/capacitor-google-auth@hproinformatica/functions@humanity.cash/typeseslint-plugin-templewallet-testeditor.js-custom-multiple-selectedelviraerlocogonzales08epm-npm-tscerikoalames-create-array-iteratores-iterator-helpers@hieuquang2212/formes-mapes-react-bridgees-set@hansomware/tools@hbglobal/react-native-actions-shortcutsenefti-galerievanutilsexpo-renavigateex-ikon-components-libraryfbkocakfawaterak-online-paymentfawatrak-online-paymentferlinanons23fernandotorest45@inti-ar/evm-chains@i-mediasolutions/capacitor-sharefaturohman@idas1/ui-component-lib@icetee/react-recaptcha-v3@ifanshx/cycgods@innoswap/core@eliteswap/token-lists@eki-group/svelvet@firstday/firstdayteh@geeky-apo/react-native-advanced-clipboarddynamics-contracts-x@gericuz/tea-fairlyeditorjs_forked@glyw/react-native-tabbed-section-list
1.0.7

2 months ago

1.0.6

6 months ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago