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 2.0.83 to 2.0.84

2

package.json
{
"name": "extra-lists",
"version": "2.0.83",
"version": "2.0.84",
"description": "Standard utility methods for Lists.",

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

@@ -1,58 +0,105 @@

Standard utility methods for [Lists]. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]
Browserified, minified module: [extra-lists.min].
[Lists] is a pair of key list and value list, with unique keys. [:running:] [:vhs:] [:package:] [:moon:] [:ledger:]
Methods as separate packages:
- `@extra-lists/find`: use [rollup] to bundle this es module.
- `@extra-lists/find.min`: use in browser ([browserify], [uglify-js]).
In this fourth Crust of Rust video, we cover smart pointers and interior
mutability, by re-implementing the Cell, RefCell, and Rc types from the
standard library. As part of that, we cover when those types are useful,
how they work, and what the equivalent thread-safe versions of these types
are. In the process, we go over some of the finer details of Rust's
ownership model, and the UnsafeCell type. [(1)]
> Stability: Experimental.
```javascript
const Lists = require('extra-lists');
// Lists.is(<value>)
// Lists.equal(<lists-1>, <lists-2>)
// ...
```
const lists = require('extra-lists');
// import * as lists from 'extra-lists';
// import * as lists from 'https://unpkg.com/extra-lists@2.1.0/index.mjs'; (deno)
Datatype methods:
- [is](https://www.npmjs.com/package/@extra-lists/is)
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 ] ]
About methods:
- [equal](https://www.npmjs.com/package/@extra-lists/equal)
- [size](https://www.npmjs.com/package/@extra-lists/size)
- [first](https://www.npmjs.com/package/@extra-lists/first)
- [middle](https://www.npmjs.com/package/@extra-lists/middle)
- [last](https://www.npmjs.com/package/@extra-lists/last)
- [keys](https://www.npmjs.com/package/@extra-lists/keys)
- [values](https://www.npmjs.com/package/@extra-lists/values)
- [entries](https://www.npmjs.com/package/@extra-lists/entries)
var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
lists.some(x, v => v > 10);
// false
Search methods:
- [indexOf](https://www.npmjs.com/package/@extra-lists/index-of)
- [lastIndexOf](https://www.npmjs.com/package/@extra-lists/last-index-of)
- [indicesOf](https://www.npmjs.com/package/@extra-lists/indices-of)
- [includes](https://www.npmjs.com/package/@extra-lists/includes)
var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
lists.min(x);
// [ 'd', -4 ]
Transform methods:
- [join](https://www.npmjs.com/package/@extra-lists/join)
- [concat](https://www.npmjs.com/package/@extra-lists/concat)
var x = [['a', 'b', 'c'], [1, 2, 3]];
[...lists.submaps(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 ] ]
// ]
```
Functional methods:
- [forEach](https://www.npmjs.com/package/@extra-lists/for-each)
- [some](https://www.npmjs.com/package/@extra-lists/some)
- [every](https://www.npmjs.com/package/@extra-lists/every)
- [find](https://www.npmjs.com/package/@extra-lists/find)
- [findIndex](https://www.npmjs.com/package/@extra-lists/find-index)
- [findLast](https://www.npmjs.com/package/@extra-lists/find-last)
- [findLastIndex](https://www.npmjs.com/package/@extra-lists/find-last-index)
- [findAll](https://www.npmjs.com/package/@extra-lists/find-all)
- [findAllIndices](https://www.npmjs.com/package/@extra-lists/find-all-indices)
- [reduce](https://www.npmjs.com/package/@extra-lists/reduce)
- [filter](https://www.npmjs.com/package/@extra-lists/filter)
- [map](https://www.npmjs.com/package/@extra-lists/map)
### reference
| Method | Action
|-----------------------|-------
| [is] | Checks if value is entries.
| [get] | Gets value at key.
| [set] | Sets value at key.
| [remove] | Deletes an entry.
| [swap] | Exchanges two values.
| [size] | Gets size of entries.
| |
| [head] | Gets first entry.
| [take] | Keeps first n entries only.
| [shift] | Removes first entry.
| [fromLists] | Creates entries from lists.
| |
| [concat] | Appends entries from maps, preferring last.
| [flat] | Flattens nested entries to given depth.
| [chunk] | Breaks entries into chunks of given size.
| [filterAt] | Gets entries with given keys.
| |
| [map] | Updates values based on map function.
| [filter] | Keeps entries which pass a test.
| [reduce] | Reduces values to a single value.
| [range] | Finds smallest and largest entries.
| [count] | Counts values which satisfy a test.
| [partition] | Segregates values by test result.
| [cartesianProduct] | Lists cartesian product of entries.
| [some] | Checks if any value satisfies a test.
| [zip] | Combines matching entries from maps.
| |
| [union] | Gives entries present in any entries.
| [intersection] | Gives entries present in both entries.
| [difference] | Gives entries not present in another.
| [symmetricDifference] | Gives entries not present in both entries.
| [isDisjoint] | Checks if entries have no common keys.
| |
| [key] | Picks an arbitrary key.
| [value] | Picks an arbitrary value.
| [entry] | Picks an arbitrary entry.
| [submap] | Gives an arbitrary submap.
| |
| [isEmpty] | Checks if entries is empty.
| [isEqual] | Checks if two maps are equal.
| [compare] | Compares two entries.
| [find] | Finds a value passing a test.
| [search] | Finds key of an entry passing a test.
| [scanWhile] | Finds key of first entry not passing a test.
<br>
[![nodef](https://merferry.glitch.me/card/extra-entries.svg)](https://nodef.github.io)
[![nodef](https://i.imgur.com/MCb8pjO.jpg)](https://nodef.github.io)
[(1)]: https://www.youtube.com/watch?v=8O0Nt9qY_vo
[Lists]: https://www.npmjs.com/package/@extra-lists/is
[extra-lists.min]: https://www.npmjs.com/package/extra-lists.min
[:running:]: https://npm.runkit.com/extra-lists
[:vhs:]: https://asciinema.org/a/340678
[:package:]: https://www.npmjs.com/package/extra-lists
[:moon:]: https://www.npmjs.com/package/extra-lists.min
[:ledger:]: https://unpkg.com/extra-lists/
[browserify]: https://www.npmjs.com/package/browserify
[rollup]: https://www.npmjs.com/package/rollup
[uglify-js]: https://www.npmjs.com/package/uglify-js
[:vhs:]: https://asciinema.org/a/340409
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