Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

extra-lists

Package Overview
Dependencies
Maintainers
1
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extra-lists - npm Package Compare versions

Comparing version 3.0.15 to 3.0.16

2

package.json
{
"name": "extra-lists",
"version": "3.0.15",
"version": "3.0.16",
"description": "Lists is a pair of key list and value list, with unique keys.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -1,21 +0,29 @@

[Lists] is a pair of key list and value list, with unique keys.<br>
:package: [NPM](https://www.npmjs.com/package/extra-lists),
:smiley_cat: [GitHub](https://github.com/orgs/nodef/packages?repo_name=extra-lists),
:running: [RunKit](https://npm.runkit.com/extra-lists),
:vhs: [Asciinema](https://asciinema.org/a/341134),
:moon: [Minified](https://www.npmjs.com/package/extra-lists.min),
:scroll: [Files](https://unpkg.com/extra-lists/),
:newspaper: [JSDoc](https://nodef.github.io/extra-lists/),
:blue_book: [Wiki](https://github.com/nodef/extra-lists/wiki/).
A collection of functions for operating upon Lists.<br>
📦 [Node.js](https://www.npmjs.com/package/extra-lists),
🌐 [Web](https://www.npmjs.com/package/extra-lists.web),
📜 [Files](https://unpkg.com/extra-lists/),
📰 [Docs](https://nodef.github.io/extra-lists/),
📘 [Wiki](https://github.com/nodef/extra-lists/wiki/).
All functions except `from*()` take lists as 1st parameter. **Lists** are an
an alternative to [entries], represented as a pair of keys, values. Unless
*entries* are implemented as structs by [v8], lists should be more efficient.
**Lists** is a pair of key list and value list, with unique keys. It is an an
alternative to [Entries]. Unless *entries* are implemented as structs by [v8],
lists should be more space efficient. This package includes common functions
related to querying **about** lists, **generating** them, **comparing** one with
another, finding their **size**, **adding** and **removing** entries, obtaining
its **properties**, getting a **part** of it, getting a **subset** entries in
it, **finding** an entry in it, performing **functional** operations,
**manipulating** it in various ways, **combining** together lists or its
sub-entries, of performing **set operations** upon it. All functions except
`fromEntries()` take lists as 1st parameter.
Methods as separate packages:
- `@extra-lists/find`: use [rollup] to bundle this es module.
- `@extra-lists/find.min`: use in browser ([browserify], [uglify-js]).
This package is available in *Node.js* and *Web* formats. The web format
is exposed as `extra_lists` standalone variable and can be loaded from
[jsDelivr CDN].
> Stability: Experimental.
> Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
[v8]: https://v8.dev
[Entries]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries
[jsDelivr CDN]: https://cdn.jsdelivr.net/npm/extra-lists.web/index.js
<br>

@@ -26,28 +34,28 @@

// import * as lists from 'extra-lists';
// import * as lists from 'https://unpkg.com/extra-lists@2.2.2/index.mjs'; (deno)
// import * as lists from 'https://unpkg.com/extra-lists/index.mjs'; (deno)
var x = [['a', 'b', 'c', 'd', 'e'], [1, 2, 3, 4, 5]];
lists.filter(x, v => v % 2 === 1);
// [ [ 'a', 'c', 'e' ], [ 1, 3, 5 ] ]
// → [ [ 'a', 'c', 'e' ], [ 1, 3, 5 ] ]
var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
lists.some(x, v => v > 10);
// false
// → false
var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
lists.min(x);
// [ 'd', -4 ]
// → -4
var x = [['a', 'b', 'c'], [1, 2, 3]];
[...lists.subsets(x)].map(a => [[...a[0]], [...a[1]]]);
// [
// [ [], [] ],
// [ [ 'a' ], [ 1 ] ],
// [ [ 'b' ], [ 2 ] ],
// [ [ 'a', 'b' ], [ 1, 2 ] ],
// [ [ 'c' ], [ 3 ] ],
// [ [ 'a', 'c' ], [ 1, 3 ] ],
// [ [ 'b', 'c' ], [ 2, 3 ] ],
// [ [ 'a', 'b', 'c' ], [ 1, 2, 3 ] ]
// ]
// → [
// → [ [], [] ],
// → [ [ 'a' ], [ 1 ] ],
// → [ [ 'b' ], [ 2 ] ],
// → [ [ 'a', 'b' ], [ 1, 2 ] ],
// → [ [ 'c' ], [ 3 ] ],
// → [ [ 'a', 'c' ], [ 1, 3 ] ],
// → [ [ 'b', 'c' ], [ 2, 3 ] ],
// → [ [ 'a', 'b', 'c' ], [ 1, 2, 3 ] ]
// → ]
```

@@ -113,5 +121,2 @@

[Lists]: https://www.npmjs.com/package/@extra-lists/is
[entries]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries
[v8]: https://v8.dev
[browserify]: https://www.npmjs.com/package/browserify

@@ -118,0 +123,0 @@ [rollup]: https://www.npmjs.com/package/rollup

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc