@jdsalasc/solvejs-list 1.1.0 → 1.3.0
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/README.md +8 -11
- package/dist/cjs/index.cjs +99 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.d.ts +49 -0
- package/dist/esm/index.js +93 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
# @jdsalasc/solvejs-list
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Zero-dependency array/list tools for common data transformation workflows.
|
|
4
|
+
|
|
5
|
+
## Tools Included
|
|
6
|
+
|
|
7
|
+
- `unique`, `compact`, `chunk`
|
|
8
|
+
- `uniqueBy`, `groupBy`, `keyBy`
|
|
9
|
+
- `partition`, `intersection`, `difference`
|
|
10
|
+
- `sortBy`
|
|
4
11
|
|
|
5
12
|
## Install
|
|
6
13
|
|
|
7
14
|
```bash
|
|
8
15
|
npm i @jdsalasc/solvejs-list
|
|
9
16
|
```
|
|
10
|
-
|
|
11
|
-
## Example
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { unique, chunk, groupBy } from "@jdsalasc/solvejs-list";
|
|
15
|
-
|
|
16
|
-
unique([1, 1, 2, 3]);
|
|
17
|
-
chunk([1, 2, 3, 4], 2);
|
|
18
|
-
groupBy(["one", "two", "three"], item => item.length);
|
|
19
|
-
```
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.unique = unique;
|
|
4
|
+
exports.uniqueBy = uniqueBy;
|
|
4
5
|
exports.compact = compact;
|
|
5
6
|
exports.chunk = chunk;
|
|
6
7
|
exports.groupBy = groupBy;
|
|
8
|
+
exports.partition = partition;
|
|
9
|
+
exports.keyBy = keyBy;
|
|
10
|
+
exports.intersection = intersection;
|
|
11
|
+
exports.difference = difference;
|
|
12
|
+
exports.sortBy = sortBy;
|
|
7
13
|
/**
|
|
8
14
|
* Removes duplicate values preserving first-seen order.
|
|
9
15
|
*
|
|
@@ -13,6 +19,25 @@ exports.groupBy = groupBy;
|
|
|
13
19
|
function unique(values) {
|
|
14
20
|
return [...new Set(values)];
|
|
15
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Removes duplicates by a derived key while preserving first-seen order.
|
|
24
|
+
*
|
|
25
|
+
* @param values - Input collection.
|
|
26
|
+
* @param selector - Key selector function.
|
|
27
|
+
* @returns Deduplicated array by selector key.
|
|
28
|
+
*/
|
|
29
|
+
function uniqueBy(values, selector) {
|
|
30
|
+
const seen = new Set();
|
|
31
|
+
const output = [];
|
|
32
|
+
for (const value of values) {
|
|
33
|
+
const key = selector(value);
|
|
34
|
+
if (!seen.has(key)) {
|
|
35
|
+
seen.add(key);
|
|
36
|
+
output.push(value);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return output;
|
|
40
|
+
}
|
|
16
41
|
/**
|
|
17
42
|
* Removes falsy values from a list.
|
|
18
43
|
*
|
|
@@ -57,4 +82,78 @@ function groupBy(values, selector) {
|
|
|
57
82
|
return accumulator;
|
|
58
83
|
}, {});
|
|
59
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Partitions values into two groups based on a predicate.
|
|
87
|
+
*
|
|
88
|
+
* @param values - Input collection.
|
|
89
|
+
* @param predicate - Predicate function.
|
|
90
|
+
* @returns Tuple with `[matched, unmatched]` values.
|
|
91
|
+
*/
|
|
92
|
+
function partition(values, predicate) {
|
|
93
|
+
const matched = [];
|
|
94
|
+
const unmatched = [];
|
|
95
|
+
for (const value of values) {
|
|
96
|
+
if (predicate(value)) {
|
|
97
|
+
matched.push(value);
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
unmatched.push(value);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return [matched, unmatched];
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Creates an object map from list values keyed by selector output.
|
|
107
|
+
*
|
|
108
|
+
* @param values - Input collection.
|
|
109
|
+
* @param selector - Key selector function.
|
|
110
|
+
* @returns Object map of values by key.
|
|
111
|
+
*/
|
|
112
|
+
function keyBy(values, selector) {
|
|
113
|
+
return values.reduce((accumulator, value) => {
|
|
114
|
+
accumulator[selector(value)] = value;
|
|
115
|
+
return accumulator;
|
|
116
|
+
}, {});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Returns intersection between two arrays preserving order from the first one.
|
|
120
|
+
*
|
|
121
|
+
* @param left - Left collection.
|
|
122
|
+
* @param right - Right collection.
|
|
123
|
+
* @returns Values found in both collections.
|
|
124
|
+
*/
|
|
125
|
+
function intersection(left, right) {
|
|
126
|
+
const rightSet = new Set(right);
|
|
127
|
+
return left.filter((value) => rightSet.has(value));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Returns items present in the left array and absent from the right array.
|
|
131
|
+
*
|
|
132
|
+
* @param left - Left collection.
|
|
133
|
+
* @param right - Right collection.
|
|
134
|
+
* @returns Difference array (`left - right`).
|
|
135
|
+
*/
|
|
136
|
+
function difference(left, right) {
|
|
137
|
+
const rightSet = new Set(right);
|
|
138
|
+
return left.filter((value) => !rightSet.has(value));
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Sorts values by selector output.
|
|
142
|
+
*
|
|
143
|
+
* @param values - Input collection.
|
|
144
|
+
* @param selector - Function selecting sortable key.
|
|
145
|
+
* @param order - Sort order.
|
|
146
|
+
* @returns New sorted array.
|
|
147
|
+
*/
|
|
148
|
+
function sortBy(values, selector, order = "asc") {
|
|
149
|
+
const factor = order === "asc" ? 1 : -1;
|
|
150
|
+
return [...values].sort((a, b) => {
|
|
151
|
+
const left = selector(a);
|
|
152
|
+
const right = selector(b);
|
|
153
|
+
if (left === right) {
|
|
154
|
+
return 0;
|
|
155
|
+
}
|
|
156
|
+
return left > right ? factor : -factor;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
60
159
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAMA,wBAEC;AAQD,0BAEC;AAUD,sBAUC;AASD,0BASC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAMA,wBAEC;AASD,4BAWC;AAQD,0BAEC;AAUD,sBAUC;AASD,0BASC;AASD,8BAWC;AASD,sBAKC;AASD,oCAGC;AASD,gCAGC;AAUD,wBAcC;AA9JD;;;;;GAKG;AACH,SAAgB,MAAM,CAAI,MAAoB;IAC5C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAA2B,MAAoB,EAAE,QAAyB;IAChG,MAAM,IAAI,GAAG,IAAI,GAAG,EAAK,CAAC;IAC1B,MAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,OAAO,CAAI,MAA0D;IACnF,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAQ,CAAC;AACvC,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAI,MAAoB,EAAE,IAAY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K,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;YACnB,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
* @returns Deduplicated array.
|
|
6
6
|
*/
|
|
7
7
|
export declare function unique<T>(values: readonly T[]): T[];
|
|
8
|
+
/**
|
|
9
|
+
* Removes duplicates by a derived key while preserving first-seen order.
|
|
10
|
+
*
|
|
11
|
+
* @param values - Input collection.
|
|
12
|
+
* @param selector - Key selector function.
|
|
13
|
+
* @returns Deduplicated array by selector key.
|
|
14
|
+
*/
|
|
15
|
+
export declare function uniqueBy<T, K extends PropertyKey>(values: readonly T[], selector: (value: T) => K): T[];
|
|
8
16
|
/**
|
|
9
17
|
* Removes falsy values from a list.
|
|
10
18
|
*
|
|
@@ -29,3 +37,44 @@ export declare function chunk<T>(values: readonly T[], size: number): T[][];
|
|
|
29
37
|
* @returns Object whose keys map to grouped arrays.
|
|
30
38
|
*/
|
|
31
39
|
export declare function groupBy<T, K extends PropertyKey>(values: readonly T[], selector: (value: T) => K): Record<K, T[]>;
|
|
40
|
+
/**
|
|
41
|
+
* Partitions values into two groups based on a predicate.
|
|
42
|
+
*
|
|
43
|
+
* @param values - Input collection.
|
|
44
|
+
* @param predicate - Predicate function.
|
|
45
|
+
* @returns Tuple with `[matched, unmatched]` values.
|
|
46
|
+
*/
|
|
47
|
+
export declare function partition<T>(values: readonly T[], predicate: (value: T) => boolean): [T[], T[]];
|
|
48
|
+
/**
|
|
49
|
+
* Creates an object map from list values keyed by selector output.
|
|
50
|
+
*
|
|
51
|
+
* @param values - Input collection.
|
|
52
|
+
* @param selector - Key selector function.
|
|
53
|
+
* @returns Object map of values by key.
|
|
54
|
+
*/
|
|
55
|
+
export declare function keyBy<T, K extends PropertyKey>(values: readonly T[], selector: (value: T) => K): Record<K, T>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns intersection between two arrays preserving order from the first one.
|
|
58
|
+
*
|
|
59
|
+
* @param left - Left collection.
|
|
60
|
+
* @param right - Right collection.
|
|
61
|
+
* @returns Values found in both collections.
|
|
62
|
+
*/
|
|
63
|
+
export declare function intersection<T>(left: readonly T[], right: readonly T[]): T[];
|
|
64
|
+
/**
|
|
65
|
+
* Returns items present in the left array and absent from the right array.
|
|
66
|
+
*
|
|
67
|
+
* @param left - Left collection.
|
|
68
|
+
* @param right - Right collection.
|
|
69
|
+
* @returns Difference array (`left - right`).
|
|
70
|
+
*/
|
|
71
|
+
export declare function difference<T>(left: readonly T[], right: readonly T[]): T[];
|
|
72
|
+
/**
|
|
73
|
+
* Sorts values by selector output.
|
|
74
|
+
*
|
|
75
|
+
* @param values - Input collection.
|
|
76
|
+
* @param selector - Function selecting sortable key.
|
|
77
|
+
* @param order - Sort order.
|
|
78
|
+
* @returns New sorted array.
|
|
79
|
+
*/
|
|
80
|
+
export declare function sortBy<T, K extends number | string>(values: readonly T[], selector: (value: T) => K, order?: "asc" | "desc"): T[];
|
package/dist/esm/index.js
CHANGED
|
@@ -7,6 +7,25 @@
|
|
|
7
7
|
export function unique(values) {
|
|
8
8
|
return [...new Set(values)];
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Removes duplicates by a derived key while preserving first-seen order.
|
|
12
|
+
*
|
|
13
|
+
* @param values - Input collection.
|
|
14
|
+
* @param selector - Key selector function.
|
|
15
|
+
* @returns Deduplicated array by selector key.
|
|
16
|
+
*/
|
|
17
|
+
export function uniqueBy(values, selector) {
|
|
18
|
+
const seen = new Set();
|
|
19
|
+
const output = [];
|
|
20
|
+
for (const value of values) {
|
|
21
|
+
const key = selector(value);
|
|
22
|
+
if (!seen.has(key)) {
|
|
23
|
+
seen.add(key);
|
|
24
|
+
output.push(value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return output;
|
|
28
|
+
}
|
|
10
29
|
/**
|
|
11
30
|
* Removes falsy values from a list.
|
|
12
31
|
*
|
|
@@ -51,4 +70,78 @@ export function groupBy(values, selector) {
|
|
|
51
70
|
return accumulator;
|
|
52
71
|
}, {});
|
|
53
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Partitions values into two groups based on a predicate.
|
|
75
|
+
*
|
|
76
|
+
* @param values - Input collection.
|
|
77
|
+
* @param predicate - Predicate function.
|
|
78
|
+
* @returns Tuple with `[matched, unmatched]` values.
|
|
79
|
+
*/
|
|
80
|
+
export function partition(values, predicate) {
|
|
81
|
+
const matched = [];
|
|
82
|
+
const unmatched = [];
|
|
83
|
+
for (const value of values) {
|
|
84
|
+
if (predicate(value)) {
|
|
85
|
+
matched.push(value);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
unmatched.push(value);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return [matched, unmatched];
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Creates an object map from list values keyed by selector output.
|
|
95
|
+
*
|
|
96
|
+
* @param values - Input collection.
|
|
97
|
+
* @param selector - Key selector function.
|
|
98
|
+
* @returns Object map of values by key.
|
|
99
|
+
*/
|
|
100
|
+
export function keyBy(values, selector) {
|
|
101
|
+
return values.reduce((accumulator, value) => {
|
|
102
|
+
accumulator[selector(value)] = value;
|
|
103
|
+
return accumulator;
|
|
104
|
+
}, {});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Returns intersection between two arrays preserving order from the first one.
|
|
108
|
+
*
|
|
109
|
+
* @param left - Left collection.
|
|
110
|
+
* @param right - Right collection.
|
|
111
|
+
* @returns Values found in both collections.
|
|
112
|
+
*/
|
|
113
|
+
export function intersection(left, right) {
|
|
114
|
+
const rightSet = new Set(right);
|
|
115
|
+
return left.filter((value) => rightSet.has(value));
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Returns items present in the left array and absent from the right array.
|
|
119
|
+
*
|
|
120
|
+
* @param left - Left collection.
|
|
121
|
+
* @param right - Right collection.
|
|
122
|
+
* @returns Difference array (`left - right`).
|
|
123
|
+
*/
|
|
124
|
+
export function difference(left, right) {
|
|
125
|
+
const rightSet = new Set(right);
|
|
126
|
+
return left.filter((value) => !rightSet.has(value));
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Sorts values by selector output.
|
|
130
|
+
*
|
|
131
|
+
* @param values - Input collection.
|
|
132
|
+
* @param selector - Function selecting sortable key.
|
|
133
|
+
* @param order - Sort order.
|
|
134
|
+
* @returns New sorted array.
|
|
135
|
+
*/
|
|
136
|
+
export function sortBy(values, selector, order = "asc") {
|
|
137
|
+
const factor = order === "asc" ? 1 : -1;
|
|
138
|
+
return [...values].sort((a, b) => {
|
|
139
|
+
const left = selector(a);
|
|
140
|
+
const right = selector(b);
|
|
141
|
+
if (left === right) {
|
|
142
|
+
return 0;
|
|
143
|
+
}
|
|
144
|
+
return left > right ? factor : -factor;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
54
147
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAI,MAAoB;IAC5C,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAI,MAA0D;IACnF,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAQ,CAAC;AACvC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAI,MAAoB,EAAE,IAAY;IACzD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAA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AI,GAAG,CAAC,KAAK,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,MAAM,CACpB,MAAoB,EACpB,QAAyB,EACzB,QAAwB,KAAK;IAE7B,MAAM,MAAM,GAAG,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,KAAK,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC1B,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;YACnB,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACzC,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jdsalasc/solvejs-list",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Zero-dependency list toolkit for JS/TS: uniqueBy, groupBy, keyBy, partition, intersection, difference, and sortBy.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -43,10 +43,13 @@
|
|
|
43
43
|
"node": ">=18"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
|
46
|
-
"array
|
|
46
|
+
"array utils",
|
|
47
|
+
"typescript list utils",
|
|
47
48
|
"groupby",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
49
|
+
"uniqueby",
|
|
50
|
+
"difference array",
|
|
51
|
+
"sortby",
|
|
52
|
+
"zero dependency",
|
|
50
53
|
"solvejs"
|
|
51
54
|
]
|
|
52
55
|
}
|