Skip to content

Commit

Permalink
🐛 docs: update require name
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfram77 committed Apr 14, 2023
1 parent 55a7d01 commit 0a738af
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions README.md
Expand Up @@ -16,9 +16,9 @@ it, **finding** an entry in it, performing **functional** operations,
sub-entries, of performing **set operations** upon it. All functions except
`fromEntries()` take lists as 1st parameter.

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].
This package is available in *Node.js* and *Web* formats. To use it on the web,
simply use the `extra_lists` global variable after loading with a `<script>`
tag from the [jsDelivr CDN].

> Stability: [Experimental](https://www.youtube.com/watch?v=L1j93RnIxEo).
Expand All @@ -29,24 +29,24 @@ is exposed as `extra_lists` standalone variable and can be loaded from
<br>

```javascript
const lists = require('extra-lists');
// import * as lists from 'extra-lists';
// import * as lists from 'https://unpkg.com/extra-lists/index.mjs'; (deno)
const xlists = require('extra-lists');
// import * as xlists from 'extra-lists';
// import * as xlists 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);
xlists.filter(x, v => v % 2 === 1);
// → [ [ 'a', 'c', 'e' ], [ 1, 3, 5 ] ]

var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
lists.some(x, v => v > 10);
xlists.some(x, v => v > 10);
// → false

var x = [['a', 'b', 'c', 'd'], [1, 2, -3, -4]];
lists.min(x);
xlists.min(x);
// → -4

var x = [['a', 'b', 'c'], [1, 2, 3]];
[...lists.subsets(x)].map(a => [[...a[0]], [...a[1]]]);
[...xlists.subsets(x)].map(a => [[...a[0]], [...a[1]]]);
// → [
// → [ [], [] ],
// → [ [ 'a' ], [ 1 ] ],
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "extra-lists",
"version": "4.0.0",
"version": "4.0.1",
"description": "A collection of functions for operating upon Lists.",
"main": "index.js",
"module": "index.mjs",
Expand Down
6 changes: 3 additions & 3 deletions tests/index.test.ts
@@ -1,4 +1,4 @@
import * as array from "extra-array";
import * as xarray from "extra-array";
import {
is,
keys,
Expand Down Expand Up @@ -686,9 +686,9 @@ test("zip", () => {
expect(a.map(x => [...x])).toStrictEqual([["a", "b"], [[1, 10], [2, 20]]]); // shortest
var a = zip([x, y], ([a, b]) => a + b);
expect(a.map(x => [...x])).toStrictEqual([["a", "b"], [11, 22]]);
var a = zip([x, y], null, array.some);
var a = zip([x, y], null, xarray.some);
expect(a.map(x => [...x])).toStrictEqual([["a", "b"], [[1, 10], [2, 20]]]); // shortest
var a = zip([x, y], null, array.every, 0);
var a = zip([x, y], null, xarray.every, 0);
expect(a.map(x => [...x])).toStrictEqual([["a", "b", "c"], [[1, 10], [2, 20], [3, 0]]]); // longest
});

Expand Down
2 changes: 1 addition & 1 deletion wiki
Submodule wiki updated from 2bff13 to 10dcb9

0 comments on commit 0a738af

Please sign in to comment.