@thi.ng/arrays 2.8.2 → 2.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-02-22T11:59:16Z
3
+ - **Last updated**: 2024-03-01T15:22:50Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -1,16 +1,5 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
  <!-- Please see: https://github.com/thi-ng/umbrella/blob/develop/CONTRIBUTING.md#changes-to-readme-files -->
3
- > [!IMPORTANT]
4
- > ‼️ Announcing the thi.ng user survey 2024 📋
5
- >
6
- > [Please participate in the survey here!](https://forms.gle/XacbSDEmQMPZg8197)\
7
- > (open until end of February)
8
- >
9
- > **To achieve a better sample size, I'd highly appreciate if you could
10
- > circulate the link to this survey in your own networks.**
11
- >
12
- > [Discussion](https://github.com/thi-ng/umbrella/discussions/447)
13
-
14
3
  # ![@thi.ng/arrays](https://media.thi.ng/umbrella/banners-20230807/thing-arrays.svg?02d7f5d9)
15
4
 
16
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/arrays.svg)](https://www.npmjs.com/package/@thi.ng/arrays)
@@ -22,7 +11,7 @@
22
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
23
12
  > and anti-framework.
24
13
  >
25
- > 🚀 Help me to work full-time on these projects by [sponsoring me on
14
+ > 🚀 Please help me to work full-time on these projects by [sponsoring me on
26
15
  > GitHub](https://github.com/sponsors/postspectacular). Thank you! ❤️
27
16
 
28
17
  - [About](#about)
package/arg-sort.d.ts CHANGED
@@ -8,6 +8,8 @@
8
8
  *
9
9
  * @example
10
10
  * ```ts
11
+ * import { argSort, swizzle } from "@thi.ng/arrays";
12
+ *
11
13
  * const src = ["a", "c", "d", "b"];
12
14
  *
13
15
  * argSort(src)
package/argmin.d.ts CHANGED
@@ -9,6 +9,8 @@ import type { Predicate2 } from "@thi.ng/api";
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
+ * import { argMin } from "@thi.ng/arrays";
13
+ *
12
14
  * argMin([42, 11, 66, 23])
13
15
  * // 1
14
16
  *
@@ -17,6 +17,8 @@ import type { Comparator, Fn, FnN, FnN2 } from "@thi.ng/api";
17
17
  *
18
18
  * @example
19
19
  * ```ts
20
+ * import { binarySearch } from "@thi.ng/arrays";
21
+ *
20
22
  * binarySearch([2, 4, 6], 5);
21
23
  * // -3
22
24
  * ```
@@ -81,6 +83,8 @@ export declare const binarySearch32: (buf: ArrayLike<number>, x: number) => numb
81
83
  *
82
84
  * @example
83
85
  * ```ts
86
+ * import { binarySearch, bsLT } from "@thi.ng/arrays";
87
+ *
84
88
  * bsLT(binarySearch([10, 20, 30, 40], 25))
85
89
  * // 1
86
90
  * ```
@@ -101,6 +105,8 @@ export declare const bsLE: FnN;
101
105
  *
102
106
  * @example
103
107
  * ```ts
108
+ * import { binarySearch, bsGT } from "@thi.ng/arrays";
109
+ *
104
110
  * src = [10, 20, 30, 40];
105
111
  *
106
112
  * bsGT(binarySearch(src, 25), src.length)
package/blit.d.ts CHANGED
@@ -10,6 +10,8 @@ import type { Fn3, TypedArray } from "@thi.ng/api";
10
10
  *
11
11
  * @example
12
12
  * ```ts
13
+ * import { blit1d } from "@thi.ng/arrays";
14
+ *
13
15
  * blit1d(
14
16
  * // dest array
15
17
  * [1, 1, 1, 1, 1, 1, 1, 1, 1],
package/fill-range.d.ts CHANGED
@@ -9,6 +9,8 @@ import type { TypedArray } from "@thi.ng/api";
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
+ * import { fillRange } from "@thi.ng/arrays";
13
+ *
12
14
  * fillRange(new Array(5))
13
15
  * // [ 0, 1, 2, 3, 4 ]
14
16
  *
package/floyd-rivest.d.ts CHANGED
@@ -13,6 +13,8 @@ import type { Comparator } from "@thi.ng/api";
13
13
  *
14
14
  * @example
15
15
  * ```ts
16
+ * import { floydRivest } from "@thi.ng/arrays";
17
+ *
16
18
  * floydRivest([5, 3, -1, -10, 20, 7, 0, 4, 2], 3);
17
19
  * // [ -10, 0, -1, 2, 3, 4, 5, 20, 7 ]
18
20
  * ```
package/is-sorted.d.ts CHANGED
@@ -11,6 +11,8 @@ import type { Comparator } from "@thi.ng/api";
11
11
  *
12
12
  * @example
13
13
  * ```ts
14
+ * import { isSorted } from "@thi.ng/arrays";
15
+ *
14
16
  * isSorted([3, 2, 1])
15
17
  * // false
16
18
  *
package/levenshtein.d.ts CHANGED
@@ -14,6 +14,8 @@ import type { Predicate2 } from "@thi.ng/api";
14
14
  *
15
15
  * @example
16
16
  * ```ts
17
+ * import { levenshtein } from "@thi.ng/arrays";
18
+ *
17
19
  * levenshtein([1, 2, 3, 4, 5], [1, 2, 4, 3, 5]);
18
20
  * // 2
19
21
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/arrays",
3
- "version": "2.8.2",
3
+ "version": "2.8.4",
4
4
  "description": "Array / Arraylike utilities",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -35,12 +35,12 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "@thi.ng/api": "^8.9.25",
39
- "@thi.ng/checks": "^3.5.0",
40
- "@thi.ng/compare": "^2.2.21",
41
- "@thi.ng/equiv": "^2.1.49",
42
- "@thi.ng/errors": "^2.4.18",
43
- "@thi.ng/random": "^3.6.32"
38
+ "@thi.ng/api": "^8.9.27",
39
+ "@thi.ng/checks": "^3.5.1",
40
+ "@thi.ng/compare": "^2.2.23",
41
+ "@thi.ng/equiv": "^2.1.50",
42
+ "@thi.ng/errors": "^2.4.19",
43
+ "@thi.ng/random": "^3.6.34"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@microsoft/api-extractor": "^7.40.1",
@@ -165,5 +165,5 @@
165
165
  "thi.ng": {
166
166
  "year": 2018
167
167
  },
168
- "gitHead": "4513a1c703bdbf0f0867f03e547e47692e415fac\n"
168
+ "gitHead": "d660ae8fd1bf64d919b4334f19509f1f539d70f6\n"
169
169
  }
package/quicksort.d.ts CHANGED
@@ -17,6 +17,8 @@ import type { Comparator, Fn3, TypedArray } from "@thi.ng/api";
17
17
  *
18
18
  * @example
19
19
  * ```ts
20
+ * import { quickSort } from "@thi.ng/arrays";
21
+ *
20
22
  * a = [4, 3, 1, 8, 5]
21
23
  * b = [40, 30, 10, 80, 50]
22
24
  * c = [-4, -3, -1, -8, -5]
package/sort-cached.d.ts CHANGED
@@ -14,6 +14,8 @@ import type { Comparator, Fn } from "@thi.ng/api";
14
14
  *
15
15
  * @example
16
16
  * ```ts
17
+ * import { sortByCachedKey } from "@thi.ng/arrays";
18
+ *
17
19
  * // sort by length in descending order
18
20
  * sortByCachedKey(["a","bbbb","ccc","dd"], (x) => x.length, (a, b) => b - a);
19
21
  * // [ 'bbbb', 'ccc', 'dd', 'a' ]
package/swap.d.ts CHANGED
@@ -22,6 +22,8 @@ export declare const swap: (arr: AnyArray, x: number, y: number) => void;
22
22
  *
23
23
  * @example
24
24
  * ```ts
25
+ * import { multiSwap } from "@thi.ng/arrays";
26
+ *
25
27
  * a = [2, 1];
26
28
  * b = [20, 10];
27
29
  * c = [40, 30];
package/swizzle.d.ts CHANGED
@@ -9,6 +9,8 @@ import type { Fn } from "@thi.ng/api";
9
9
  *
10
10
  * @example
11
11
  * ```ts
12
+ * import { swizzle } from "@thi.ng/arrays";
13
+ *
12
14
  * swizzle([0, 0, 0])([1, 2, 3, 4]) // [ 1, 1, 1 ]
13
15
  * swizzle([1, 1, 3, 3])([1, 2, 3, 4]) // [ 2, 2, 4, 4 ]
14
16
  * swizzle([2, 0])([1, 2, 3]) // [ 3, 1 ]
package/threshold.d.ts CHANGED
@@ -10,6 +10,8 @@
10
10
  *
11
11
  * @example
12
12
  * ```ts
13
+ * import { selectThresholdMin } from "@thi.ng/arrays";
14
+ *
13
15
  * const numColumns = selectThresholdMin({ 480: 1, 640: 2, 960: 3 }, 4);
14
16
  *
15
17
  * numColumns(320) // 1
package/topo-sort.d.ts CHANGED
@@ -12,6 +12,8 @@ import type { Fn, Nullable, IObjectOf } from "@thi.ng/api";
12
12
  *
13
13
  * @example
14
14
  * ```ts
15
+ * import { topoSort } from "@thi.ng/arrays";
16
+ *
15
17
  * const graph = {
16
18
  * a: { deps: ["c", "b"] },
17
19
  * b: {},