@lowentry/utils 1.18.1 → 1.19.1
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/api-extractor.json +40 -0
- package/build/LeTypes.d.ts +15 -0
- package/build/LeUtils.d.ts +218 -0
- package/build/classes/LinkedList.d.ts +33 -0
- package/build/classes/SerializableMap.d.ts +17 -0
- package/build/index.d.ts +4 -0
- package/index.d.ts +301 -0
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +7 -6
- package/src/LeUtils.js +1 -1
- package/tests/each.test.js +3 -5
- package/tests/sort.test.js +1 -1
- package/tsconfig.d.ts +1 -3
- package/tsconfig.json +15 -3
- package/jest.config.mjs +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowentry/utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"build": "npm exec -- rollup -c",
|
|
22
22
|
"prepublishOnly": "rm -r src && mv dist/* ./ && rm -r dist",
|
|
23
|
-
"test": "npx tsc &&
|
|
23
|
+
"test": "npx tsc && vitest run"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "*",
|
|
@@ -37,20 +37,21 @@
|
|
|
37
37
|
"@babel/plugin-transform-runtime": "^7.24.7",
|
|
38
38
|
"@babel/preset-env": "^7.24.7",
|
|
39
39
|
"@babel/preset-react": "^7.24.7",
|
|
40
|
+
"@microsoft/api-extractor": "^7.52.8",
|
|
41
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
40
42
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
41
43
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
42
44
|
"@rollup/plugin-url": "^8.0.2",
|
|
43
45
|
"autoprefixer": "^10.4.19",
|
|
44
46
|
"cssnano": "^7.0.2",
|
|
45
47
|
"fs-extra": "^11.2.0",
|
|
46
|
-
"jest": "^30.0.3",
|
|
47
48
|
"less": "^4.2.0",
|
|
48
49
|
"rollup": "^2.79.1",
|
|
49
|
-
"rollup-plugin-
|
|
50
|
+
"rollup-plugin-execute": "^1.1.1",
|
|
50
51
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
51
52
|
"rollup-plugin-postcss": "^4.0.2",
|
|
52
53
|
"sass": "^1.77.5",
|
|
53
|
-
"
|
|
54
|
-
"
|
|
54
|
+
"typescript": "^5.8.3",
|
|
55
|
+
"vitest": "^3.2.4"
|
|
55
56
|
}
|
|
56
57
|
}
|
package/src/LeUtils.js
CHANGED
|
@@ -593,7 +593,7 @@ export const LeUtils = {
|
|
|
593
593
|
*
|
|
594
594
|
* @param {*} elements
|
|
595
595
|
* @param {boolean} [optionalSkipHasOwnPropertyCheck]
|
|
596
|
-
* @
|
|
596
|
+
* @yields {[key:*, value:*]}
|
|
597
597
|
*/
|
|
598
598
|
eachIterator:
|
|
599
599
|
function* (elements, optionalSkipHasOwnPropertyCheck = false)
|
package/tests/each.test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {describe, test, expect
|
|
1
|
+
import {describe, test, expect} from 'vitest';
|
|
2
2
|
import {LeUtils} from '../src/index.js';
|
|
3
3
|
|
|
4
4
|
const wait = ms => LeUtils.promiseTimeout(ms ?? 100);
|
|
@@ -433,7 +433,6 @@ describe('LeUtils.supportsEach() custom forEach object and function', () =>
|
|
|
433
433
|
|
|
434
434
|
describe('LeUtils.eachAsync() heavy parallel', () =>
|
|
435
435
|
{
|
|
436
|
-
jest.setTimeout(10000);
|
|
437
436
|
test('processes 100 items with concurrency 20', async () =>
|
|
438
437
|
{
|
|
439
438
|
const size = 100;
|
|
@@ -453,7 +452,7 @@ describe('LeUtils.eachAsync() heavy parallel', () =>
|
|
|
453
452
|
);
|
|
454
453
|
expect(max.length).toBe(size);
|
|
455
454
|
expect(Math.max(...max)).toBeLessThanOrEqual(20);
|
|
456
|
-
});
|
|
455
|
+
}, 10000);
|
|
457
456
|
test('serial path matches sequential order with strings', async () =>
|
|
458
457
|
{
|
|
459
458
|
const seen = [];
|
|
@@ -639,7 +638,6 @@ describe('LeUtils.getEmptySimplifiedCollection() extra', () =>
|
|
|
639
638
|
|
|
640
639
|
describe('LeUtils.eachAsync() stress 1000 items', () =>
|
|
641
640
|
{
|
|
642
|
-
jest.setTimeout(20000);
|
|
643
641
|
test('parallel 200 completes', async () =>
|
|
644
642
|
{
|
|
645
643
|
const N = 1000;
|
|
@@ -651,7 +649,7 @@ describe('LeUtils.eachAsync() stress 1000 items', () =>
|
|
|
651
649
|
await wait();
|
|
652
650
|
}, 200);
|
|
653
651
|
expect(count).toBe(N);
|
|
654
|
-
});
|
|
652
|
+
}, 20000);
|
|
655
653
|
test('early false stops further enqueues', async () =>
|
|
656
654
|
{
|
|
657
655
|
const list = [...Array(50).keys()];
|
package/tests/sort.test.js
CHANGED
package/tsconfig.d.ts
CHANGED
package/tsconfig.json
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
"allowJs": true,
|
|
4
4
|
"checkJs": true,
|
|
5
5
|
"strict": true,
|
|
6
|
-
"noEmit": true,
|
|
7
6
|
"noImplicitAny": false,
|
|
8
7
|
"noImplicitThis": false,
|
|
9
8
|
"alwaysStrict": true,
|
|
@@ -15,7 +14,14 @@
|
|
|
15
14
|
"module": "esnext",
|
|
16
15
|
"moduleResolution": "node",
|
|
17
16
|
"skipLibCheck": true,
|
|
18
|
-
"types": []
|
|
17
|
+
"types": [],
|
|
18
|
+
"noEmit": false,
|
|
19
|
+
"declaration": true,
|
|
20
|
+
"declarationMap": false,
|
|
21
|
+
"outDir": "./build",
|
|
22
|
+
"removeComments": false,
|
|
23
|
+
"stripInternal": true,
|
|
24
|
+
"emitDeclarationOnly": true
|
|
19
25
|
},
|
|
20
26
|
"include": [
|
|
21
27
|
"tsconfig.d.ts",
|
|
@@ -23,5 +29,11 @@
|
|
|
23
29
|
],
|
|
24
30
|
"exclude": [
|
|
25
31
|
"node_modules"
|
|
26
|
-
]
|
|
32
|
+
],
|
|
33
|
+
"typeAcquisition": {
|
|
34
|
+
"include": [
|
|
35
|
+
"react",
|
|
36
|
+
"react-dom"
|
|
37
|
+
]
|
|
38
|
+
}
|
|
27
39
|
}
|
package/jest.config.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
preset: 'ts-jest/presets/js-with-ts-esm',
|
|
3
|
-
globals: {
|
|
4
|
-
extensionsToTreatAsEsm:['.ts', '.js', '.mjs', '.mjsx'],
|
|
5
|
-
},
|
|
6
|
-
transform: {
|
|
7
|
-
'^.+\\.[tj]sx?$|^.+\\.mjsx?$':['ts-jest', {useESM:true}],
|
|
8
|
-
},
|
|
9
|
-
moduleFileExtensions:['ts', 'tsx', 'js', 'jsx', 'mjs', 'mjsx', 'json', 'node'],
|
|
10
|
-
};
|