@thi.ng/arrays 2.0.3 → 2.0.8

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
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [2.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@2.0.2...@thi.ng/arrays@2.0.3) (2021-10-15)
6
+ ## [2.0.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@2.0.7...@thi.ng/arrays@2.0.8) (2021-11-10)
7
7
 
8
8
  **Note:** Version bump only for package @thi.ng/arrays
9
9
 
@@ -11,15 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
- ## [2.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@2.0.1...@thi.ng/arrays@2.0.2) (2021-10-15)
15
-
16
- **Note:** Version bump only for package @thi.ng/arrays
17
-
18
-
19
-
20
-
21
-
22
- ## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@2.0.0...@thi.ng/arrays@2.0.1) (2021-10-13)
14
+ ## [2.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@2.0.6...@thi.ng/arrays@2.0.7) (2021-11-03)
23
15
 
24
16
  **Note:** Version bump only for package @thi.ng/arrays
25
17
 
@@ -56,76 +48,76 @@ Also:
56
48
 
57
49
 
58
50
 
59
- ## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@1.0.2...@thi.ng/arrays@1.0.3) (2021-09-03)
51
+ ## [1.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@1.0.2...@thi.ng/arrays@1.0.3) (2021-09-03)
60
52
 
61
- **Note:** Version bump only for package @thi.ng/arrays
53
+ **Note:** Version bump only for package @thi.ng/arrays
62
54
 
63
- # [0.10.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.9.2...@thi.ng/arrays@0.10.0) (2021-01-21)
55
+ # [0.10.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.9.2...@thi.ng/arrays@0.10.0) (2021-01-21)
64
56
 
65
- ### Bug Fixes
57
+ ### Bug Fixes
66
58
 
67
- - **arrays:** fixed-length binarySearch2/4/8/16/32 ([39e5c37](https://github.com/thi-ng/umbrella/commit/39e5c3736135f9a49daceee1fe4da9fbdbb96eab))
59
+ - **arrays:** fixed-length binarySearch2/4/8/16/32 ([39e5c37](https://github.com/thi-ng/umbrella/commit/39e5c3736135f9a49daceee1fe4da9fbdbb96eab))
68
60
 
69
- ### Features
61
+ ### Features
70
62
 
71
- - **arrays:** add insert/insertUnsafe() ([2a78598](https://github.com/thi-ng/umbrella/commit/2a7859823d2fb56eef4ee7a6919fe70072475f42))
63
+ - **arrays:** add insert/insertUnsafe() ([2a78598](https://github.com/thi-ng/umbrella/commit/2a7859823d2fb56eef4ee7a6919fe70072475f42))
72
64
 
73
- # [0.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.5...@thi.ng/arrays@0.9.0) (2021-01-02)
65
+ # [0.9.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.8.5...@thi.ng/arrays@0.9.0) (2021-01-02)
74
66
 
75
- ### Features
67
+ ### Features
76
68
 
77
- - **arrays:** add bisect(), bisectWith() ([17d06a4](https://github.com/thi-ng/umbrella/commit/17d06a43e338aca5f2dc61110382363639daecc5))
78
- - **arrays:** add into(), sortByCachedKey() ([b94f64c](https://github.com/thi-ng/umbrella/commit/b94f64c2c351cfed5ea9ade5e42ad0b7076ef9e9))
79
- - **arrays:** update sortByCachedKey(), add tests ([64e8f6e](https://github.com/thi-ng/umbrella/commit/64e8f6e4e83c26c73e23a4831483bd328b78bc49))
69
+ - **arrays:** add bisect(), bisectWith() ([17d06a4](https://github.com/thi-ng/umbrella/commit/17d06a43e338aca5f2dc61110382363639daecc5))
70
+ - **arrays:** add into(), sortByCachedKey() ([b94f64c](https://github.com/thi-ng/umbrella/commit/b94f64c2c351cfed5ea9ade5e42ad0b7076ef9e9))
71
+ - **arrays:** update sortByCachedKey(), add tests ([64e8f6e](https://github.com/thi-ng/umbrella/commit/64e8f6e4e83c26c73e23a4831483bd328b78bc49))
80
72
 
81
- # [0.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.7.0...@thi.ng/arrays@0.8.0) (2020-09-13)
73
+ # [0.8.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.7.0...@thi.ng/arrays@0.8.0) (2020-09-13)
82
74
 
83
- ### Features
75
+ ### Features
84
76
 
85
- - **arrays:** add first() ([3f5f722](https://github.com/thi-ng/umbrella/commit/3f5f7226e5c0495086c973a33e91fc2666f4c68c))
77
+ - **arrays:** add first() ([3f5f722](https://github.com/thi-ng/umbrella/commit/3f5f7226e5c0495086c973a33e91fc2666f4c68c))
86
78
 
87
- # [0.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.6.15...@thi.ng/arrays@0.7.0) (2020-08-28)
79
+ # [0.7.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.6.15...@thi.ng/arrays@0.7.0) (2020-08-28)
88
80
 
89
- ### Features
81
+ ### Features
90
82
 
91
- - **arrays:** add non-recursive binary search fns ([29a4ee4](https://github.com/thi-ng/umbrella/commit/29a4ee4d888ccb049df9b50a57e3884ce2d4d0f3))
83
+ - **arrays:** add non-recursive binary search fns ([29a4ee4](https://github.com/thi-ng/umbrella/commit/29a4ee4d888ccb049df9b50a57e3884ce2d4d0f3))
92
84
 
93
- # [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.5.6...@thi.ng/arrays@0.6.0) (2020-03-28)
85
+ # [0.6.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.5.6...@thi.ng/arrays@0.6.0) (2020-03-28)
94
86
 
95
- ### Features
87
+ ### Features
96
88
 
97
- - **arrays:** add fillRange() & levenshtein() ([2f98225](https://github.com/thi-ng/umbrella/commit/2f98225d129c7c1ae6b88a4f0bea9227254fcf91))
89
+ - **arrays:** add fillRange() & levenshtein() ([2f98225](https://github.com/thi-ng/umbrella/commit/2f98225d129c7c1ae6b88a4f0bea9227254fcf91))
98
90
 
99
- # [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.4.0...@thi.ng/arrays@0.5.0) (2020-01-24)
91
+ # [0.5.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.4.0...@thi.ng/arrays@0.5.0) (2020-01-24)
100
92
 
101
- ### Features
93
+ ### Features
102
94
 
103
- - **arrays:** add binary search predicates, tests, update readme ([b8f421e](https://github.com/thi-ng/umbrella/commit/b8f421eb8888fa1b57a9287f6841cd29952bf19f))
95
+ - **arrays:** add binary search predicates, tests, update readme ([b8f421e](https://github.com/thi-ng/umbrella/commit/b8f421eb8888fa1b57a9287f6841cd29952bf19f))
104
96
 
105
- # [0.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.3.0...@thi.ng/arrays@0.4.0) (2019-11-30)
97
+ # [0.4.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.3.0...@thi.ng/arrays@0.4.0) (2019-11-30)
106
98
 
107
- ### Features
99
+ ### Features
108
100
 
109
- - **arrays:** add arraySeq(), arrayIterator() & tests ([d94df57](https://github.com/thi-ng/umbrella/commit/d94df5786dddf6ef6915af79c3fbf0331ddfd2bd))
110
- - **arrays:** add binarySearchNumeric() ([7b38202](https://github.com/thi-ng/umbrella/commit/7b38202480db71753d24aa52a9c09d3ac78d36ae))
101
+ - **arrays:** add arraySeq(), arrayIterator() & tests ([d94df57](https://github.com/thi-ng/umbrella/commit/d94df5786dddf6ef6915af79c3fbf0331ddfd2bd))
102
+ - **arrays:** add binarySearchNumeric() ([7b38202](https://github.com/thi-ng/umbrella/commit/7b38202480db71753d24aa52a9c09d3ac78d36ae))
111
103
 
112
- # [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.2.5...@thi.ng/arrays@0.3.0) (2019-11-09)
104
+ # [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.2.5...@thi.ng/arrays@0.3.0) (2019-11-09)
113
105
 
114
- ### Features
106
+ ### Features
115
107
 
116
- - **arrays:** add isSorted() ([65b29f4](https://github.com/thi-ng/umbrella/commit/65b29f487459c535acdbed3890c8a4e27d87ae2c))
117
- - **arrays:** add shuffleRange(), refactor shuffle(), add tests ([1924a05](https://github.com/thi-ng/umbrella/commit/1924a05ea093e3d1d0b3f063cb331b330cee0c0a))
118
- - **arrays:** add types, quickSort(), swap(), multiSwap(), update readme ([b834722](https://github.com/thi-ng/umbrella/commit/b83472237b3ba262dcbb644c8ccc516d0021bc84))
108
+ - **arrays:** add isSorted() ([65b29f4](https://github.com/thi-ng/umbrella/commit/65b29f487459c535acdbed3890c8a4e27d87ae2c))
109
+ - **arrays:** add shuffleRange(), refactor shuffle(), add tests ([1924a05](https://github.com/thi-ng/umbrella/commit/1924a05ea093e3d1d0b3f063cb331b330cee0c0a))
110
+ - **arrays:** add types, quickSort(), swap(), multiSwap(), update readme ([b834722](https://github.com/thi-ng/umbrella/commit/b83472237b3ba262dcbb644c8ccc516d0021bc84))
119
111
 
120
- # [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.1.9...@thi.ng/arrays@0.2.0) (2019-07-07)
112
+ # [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/arrays@0.1.9...@thi.ng/arrays@0.2.0) (2019-07-07)
121
113
 
122
- ### Features
114
+ ### Features
123
115
 
124
- - **arrays:** enable TS strict compiler flags (refactor) ([8724f9e](https://github.com/thi-ng/umbrella/commit/8724f9e))
116
+ - **arrays:** enable TS strict compiler flags (refactor) ([8724f9e](https://github.com/thi-ng/umbrella/commit/8724f9e))
125
117
 
126
- # 0.1.0 (2019-02-15)
118
+ # 0.1.0 (2019-02-15)
127
119
 
128
- ### Features
120
+ ### Features
129
121
 
130
- - **arrays:** add find/findIndex() ([0007152](https://github.com/thi-ng/umbrella/commit/0007152))
122
+ - **arrays:** add find/findIndex() ([0007152](https://github.com/thi-ng/umbrella/commit/0007152))
131
123
  - **arrays:** extract as new package ([361ba37](https://github.com/thi-ng/umbrella/commit/361ba37))
package/README.md CHANGED
@@ -51,7 +51,7 @@ node --experimental-repl-await
51
51
  > const arrays = await import("@thi.ng/arrays");
52
52
  ```
53
53
 
54
- Package sizes (gzipped, pre-treeshake): ESM: 2.12 KB
54
+ Package sizes (gzipped, pre-treeshake): ESM: 2.24 KB
55
55
 
56
56
  ## Dependencies
57
57
 
package/ends-with.js CHANGED
@@ -20,6 +20,6 @@ export const endsWith = (buf, needle, equiv = _eq) => {
20
20
  let j = needle.length;
21
21
  if (i < j)
22
22
  return false;
23
- while ((--i, --j >= 0 && equiv(buf[i], needle[j]))) { }
23
+ while ((--i, j-- > 0 && equiv(buf[i], needle[j]))) { }
24
24
  return j < 0;
25
25
  };
package/find.js CHANGED
@@ -20,7 +20,7 @@ export const find = (buf, x, equiv = _equiv) => {
20
20
  * @param equiv - equivalence predicate
21
21
  */
22
22
  export const findIndex = (buf, x, equiv = _equiv) => {
23
- for (let i = buf.length; --i >= 0;) {
23
+ for (let i = buf.length; i-- > 0;) {
24
24
  if (equiv(x, buf[i]))
25
25
  return i;
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/arrays",
3
- "version": "2.0.3",
3
+ "version": "2.0.8",
4
4
  "description": "Array / Arraylike utilities",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -34,15 +34,15 @@
34
34
  "test": "testament test"
35
35
  },
36
36
  "dependencies": {
37
- "@thi.ng/api": "^8.0.3",
38
- "@thi.ng/checks": "^3.0.3",
39
- "@thi.ng/compare": "^2.0.3",
40
- "@thi.ng/equiv": "^2.0.3",
41
- "@thi.ng/errors": "^2.0.3",
42
- "@thi.ng/random": "^3.0.3"
37
+ "@thi.ng/api": "^8.2.0",
38
+ "@thi.ng/checks": "^3.0.7",
39
+ "@thi.ng/compare": "^2.0.8",
40
+ "@thi.ng/equiv": "^2.0.7",
41
+ "@thi.ng/errors": "^2.0.6",
42
+ "@thi.ng/random": "^3.1.4"
43
43
  },
44
44
  "devDependencies": {
45
- "@thi.ng/testament": "^0.1.3"
45
+ "@thi.ng/testament": "^0.1.6"
46
46
  },
47
47
  "keywords": [
48
48
  "aos",
@@ -135,5 +135,5 @@
135
135
  "thi.ng": {
136
136
  "year": 2018
137
137
  },
138
- "gitHead": "1fb38cac74d6c009d96855c28784a267a81badf1"
138
+ "gitHead": "5fe52419af63984ebe53032201b2a6174b9cb159"
139
139
  }
package/shuffle.js CHANGED
@@ -19,7 +19,7 @@ export const shuffleRange = (buf, start = 0, end = buf.length, rnd = SYSTEM) =>
19
19
  let n = end - start;
20
20
  const l = n;
21
21
  if (l > 1) {
22
- while (--n >= 0) {
22
+ while (n-- > 0) {
23
23
  const a = (start + rnd.float(l)) | 0;
24
24
  const b = (start + rnd.float(l)) | 0;
25
25
  const t = buf[a];
package/swap.js CHANGED
@@ -66,7 +66,7 @@ export const multiSwap = (...xs) => {
66
66
  default:
67
67
  return (a, x, y) => {
68
68
  swap(a, x, y);
69
- for (let i = n; --i >= 0;)
69
+ for (let i = n; i-- > 0;)
70
70
  swap(xs[i], x, y);
71
71
  };
72
72
  }
package/swizzle.js CHANGED
@@ -47,7 +47,7 @@ export const swizzle = (order) => {
47
47
  default:
48
48
  return (x) => {
49
49
  const res = [];
50
- for (let i = order.length; --i >= 0;) {
50
+ for (let i = order.length; i-- > 0;) {
51
51
  res[i] = x[order[i]];
52
52
  }
53
53
  return res;