Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

@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

Version published
Maintainers
1
Weekly downloads
21,071,281
increased by3.72%

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

What is @jridgewell/set-array?

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

Is @jridgewell/set-array popular?

The npm package @jridgewell/set-array receives a total of 17,699,035 weekly downloads. As such, @jridgewell/set-array popularity was classified as popular.

Is @jridgewell/set-array well maintained?

We found that @jridgewell/set-array 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.

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

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