Big news!Introducing Socket AI - ChatGPT-Powered Threat Analysis.Learn more
Socket
Socket

@jridgewell/set-array

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Issues
File Explorer

Advanced tools

@jridgewell/set-array

Like a Set, but provides the index of the `key` in the backing array

    1.1.2latest
    GitHub
    npm

Version published
Maintainers
1
Weekly downloads
23,587,624
decreased by-5.3%

Weekly downloads

Changelog

Source

v1.1.2

Internal

  • Fix built sources paths
  • fix "exports" for node 13.0-13.6

Full Changelog: https://github.com/jridgewell/set-array/compare/v1.1.1...v1.1.2

Readme

Source

@jridgewell/set-array

Like a Set, but provides the index of the key in the backing array

This is designed to allow synchronizing a second array with the contents of the backing array, like how in a sourcemap sourcesContent[i] is the source content associated with source[i], and there are never duplicates.

Installation

npm install @jridgewell/set-array

Usage

import { SetArray, get, put, pop } from '@jridgewell/set-array'; const sa = new SetArray(); let index = put(sa, 'first'); assert.strictEqual(index, 0); index = put(sa, 'second'); assert.strictEqual(index, 1); assert.deepEqual(sa.array, [ 'first', 'second' ]); index = get(sa, 'first'); assert.strictEqual(index, 0); pop(sa); index = get(sa, 'second'); assert.strictEqual(index, undefined); assert.deepEqual(sa.array, [ 'first' ]);

FAQs

Last updated on 26 Jun 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
Socket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc