@oscarpalmer/atoms 0.199.0 → 0.201.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/dist/array/flatten.d.mts +1 -1
- package/dist/array/from.d.mts +1 -1
- package/dist/array/group-by.d.mts +2 -2
- package/dist/array/index.d.mts +2 -2
- package/dist/array/index.mjs +2 -2
- package/dist/array/select.d.mts +71 -64
- package/dist/array/select.mjs +17 -2
- package/dist/array/sort.d.mts +4 -0
- package/dist/array/to-map.d.mts +2 -2
- package/dist/array/to-record.d.mts +2 -2
- package/dist/index.d.mts +131 -113
- package/dist/index.mjs +74 -29
- package/dist/internal/array/compact.d.mts +2 -2
- package/dist/internal/array/find.d.mts +5 -1
- package/dist/internal/array/find.mjs +16 -4
- package/dist/promise/constants.d.mts +3 -1
- package/dist/promise/constants.mjs +3 -1
- package/dist/promise/helpers.d.mts +1 -2
- package/dist/promise/helpers.mjs +9 -1
- package/dist/promise/index.d.mts +34 -36
- package/dist/promise/index.mjs +25 -20
- package/dist/promise/misc.mjs +2 -2
- package/dist/promise/models.d.mts +7 -6
- package/dist/queue.d.mts +4 -0
- package/dist/string/fuzzy.d.mts +2 -0
- package/dist/string/fuzzy.mjs +2 -0
- package/dist/value/freeze.d.mts +2 -0
- package/dist/value/freeze.mjs +2 -0
- package/dist/value/merge.d.mts +1 -1
- package/dist/value/merge.mjs +2 -1
- package/package.json +4 -4
- package/plugin/index.js +1 -1
package/dist/queue.d.mts
CHANGED
|
@@ -216,6 +216,8 @@ declare function isQueueInstance<Instance>(name: string, value: unknown): value
|
|
|
216
216
|
/**
|
|
217
217
|
* Create a keyed queue for an asynchronous callback function, where each key has its own queue
|
|
218
218
|
*
|
|
219
|
+
* _Available as `keyedQueue` and `queue.keyed`_
|
|
220
|
+
*
|
|
219
221
|
* @param callback Callback function for queued items
|
|
220
222
|
* @param options Queue options
|
|
221
223
|
*/
|
|
@@ -223,6 +225,8 @@ declare function keyedQueue<Callback extends (key: string, ...parameters: any[])
|
|
|
223
225
|
/**
|
|
224
226
|
* Create a keyed queue for an asynchronous callback function, where each key has its own queue
|
|
225
227
|
*
|
|
228
|
+
* _Available as `keyedQueue` and `queue.keyed`_
|
|
229
|
+
*
|
|
226
230
|
* @param callback Callback function for queued items
|
|
227
231
|
* @param options Queue options
|
|
228
232
|
*/
|
package/dist/string/fuzzy.d.mts
CHANGED
|
@@ -115,6 +115,8 @@ declare namespace fuzzy {
|
|
|
115
115
|
/**
|
|
116
116
|
* Does the needle match the haystack in a fuzzy way?
|
|
117
117
|
*
|
|
118
|
+
* _Available as `fuzzyMatch` and `fuzzy.match`_
|
|
119
|
+
*
|
|
118
120
|
* @param haystack Haystack to search through
|
|
119
121
|
* @param needle Needle to search for
|
|
120
122
|
* @returns `true` if the needle matches the haystack in a fuzzy way, otherwise `false`
|
package/dist/string/fuzzy.mjs
CHANGED
package/dist/value/freeze.d.mts
CHANGED
package/dist/value/freeze.mjs
CHANGED
package/dist/value/merge.d.mts
CHANGED
|
@@ -60,7 +60,7 @@ type Merger = {
|
|
|
60
60
|
* @param values Values to merge
|
|
61
61
|
* @returns Merged value
|
|
62
62
|
*/
|
|
63
|
-
<Values extends ArrayOrPlainObject[]>(values: NestedPartial<Values[number]
|
|
63
|
+
<Values extends ArrayOrPlainObject[]>(values: Array<NestedPartial<Values[number]>>): UnionToIntersection<Values[number]>;
|
|
64
64
|
};
|
|
65
65
|
/**
|
|
66
66
|
* Assign values from one or more objects to the first one
|
package/dist/value/merge.mjs
CHANGED
|
@@ -29,7 +29,8 @@ function createMergeOptions(options) {
|
|
|
29
29
|
}
|
|
30
30
|
function getReplaceableObjects(value) {
|
|
31
31
|
const items = (Array.isArray(value) ? value : [value]).filter((item) => typeof item === "string" || item instanceof RegExp);
|
|
32
|
-
if (items.length
|
|
32
|
+
if (items.length === 0) return;
|
|
33
|
+
return (name) => items.some((item) => typeof item === "string" ? item === name : item.test(name));
|
|
33
34
|
}
|
|
34
35
|
/**
|
|
35
36
|
* Create an assigner with predefined options
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oscarpalmer/atoms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.201.0",
|
|
4
4
|
"description": "Atomic utilities for making your JavaScript better.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"array",
|
|
@@ -278,10 +278,10 @@
|
|
|
278
278
|
"watch": "npx vite build --watch"
|
|
279
279
|
},
|
|
280
280
|
"devDependencies": {
|
|
281
|
-
"@oxlint/plugins": "^1.
|
|
282
|
-
"@types/node": "^26.
|
|
281
|
+
"@oxlint/plugins": "^1.82",
|
|
282
|
+
"@types/node": "^26.5",
|
|
283
283
|
"@vitest/coverage-istanbul": "^4.1",
|
|
284
|
-
"eslint": "^10.
|
|
284
|
+
"eslint": "^10.10",
|
|
285
285
|
"jsdom": "^30",
|
|
286
286
|
"tsdown": "^0.23",
|
|
287
287
|
"typescript": "^6",
|
package/plugin/index.js
CHANGED
|
@@ -29,7 +29,7 @@ export const mathPlugins = [
|
|
|
29
29
|
export const miscPlugins = [
|
|
30
30
|
tryCatchPlugin,
|
|
31
31
|
getPlugin('number', 'getNumber', new Set(['Number']), true, true),
|
|
32
|
-
getPlugin('promise', 'promises', new Set(['all', 'allSettled']), true),
|
|
32
|
+
getPlugin('promise', 'promises', new Set(['all', 'allKeyed', 'allSettled']), true),
|
|
33
33
|
getPlugin('value', 'assign', new Set(['assign']), true),
|
|
34
34
|
getPlugin('value', 'clone', new Set(['structuredClone']), true, true),
|
|
35
35
|
getPlugin('value', 'equal', new Set(['is']), true),
|