@webdeveric/utils 0.72.0 → 0.74.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/cjs/predicate/isTimeoutError.js +5 -0
- package/dist/cjs/sort/byRandom.js +11 -0
- package/dist/cjs/types/errors.js +2 -0
- package/dist/mjs/predicate/isTimeoutError.js +1 -0
- package/dist/mjs/sort/byRandom.js +7 -0
- package/dist/mjs/types/errors.js +1 -0
- package/dist/types/predicate/isTimeoutError.d.ts +2 -0
- package/dist/types/sort/byRandom.d.ts +1 -0
- package/dist/types/types/errors.d.ts +3 -0
- package/dist/types/types/utils.d.ts +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.byRandom = void 0;
|
|
4
|
+
const byRandom = () => {
|
|
5
|
+
let value;
|
|
6
|
+
do {
|
|
7
|
+
value = crypto.getRandomValues(new Uint8Array(1))[0];
|
|
8
|
+
} while (value >= 252);
|
|
9
|
+
return (value % 3) - 1;
|
|
10
|
+
};
|
|
11
|
+
exports.byRandom = byRandom;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const isTimeoutError = (error) => error instanceof DOMException && error.name === 'TimeoutError';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const byRandom: () => number;
|
|
@@ -37,7 +37,7 @@ export type NumberKeys<Type> = keyof Type & number;
|
|
|
37
37
|
export type StringKeys<Type> = keyof Type & string;
|
|
38
38
|
export type SymbolKeys<Type> = keyof Type & symbol;
|
|
39
39
|
export type Values<Type> = Type[keyof Type];
|
|
40
|
-
export type DeepPartial<Type> = Type extends object ? {
|
|
40
|
+
export type DeepPartial<Type> = Type extends unknown[] ? DeepPartial<Type[number]>[] : Type extends object ? {
|
|
41
41
|
[Property in keyof Type]?: DeepPartial<Type[Property]>;
|
|
42
42
|
} : Type;
|
|
43
43
|
export type UnionToIntersection<Union> = (Union extends any ? (union: Union) => void : never) extends (union: infer Type extends Union) => void ? Type : never;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webdeveric/utils",
|
|
3
3
|
"description": "Just another collection of utilities.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.74.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"url": "https://github.com/webdeveric/utils/issues"
|
|
67
67
|
},
|
|
68
68
|
"homepage": "https://github.com/webdeveric/utils/#readme",
|
|
69
|
-
"packageManager": "pnpm@10.
|
|
69
|
+
"packageManager": "pnpm@10.18.0+sha512.e804f889f1cecc40d572db084eec3e4881739f8dec69c0ff10d2d1beff9a4e309383ba27b5b750059d7f4c149535b6cd0d2cb1ed3aeb739239a4284a68f40cfa",
|
|
70
70
|
"scripts": {
|
|
71
71
|
"clean": "rimraf ./dist/",
|
|
72
72
|
"prebuild": "pnpm clean",
|
|
@@ -85,13 +85,13 @@
|
|
|
85
85
|
},
|
|
86
86
|
"prettier": "@webdeveric/prettier-config",
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@commitlint/config-conventional": "^
|
|
89
|
-
"@commitlint/types": "^
|
|
90
|
-
"@types/node": "^22.18.
|
|
88
|
+
"@commitlint/config-conventional": "^20.0.0",
|
|
89
|
+
"@commitlint/types": "^20.0.0",
|
|
90
|
+
"@types/node": "^22.18.7",
|
|
91
91
|
"@vitest/coverage-v8": "^3.2.4",
|
|
92
92
|
"@webdeveric/eslint-config-ts": "^0.11.0",
|
|
93
93
|
"@webdeveric/prettier-config": "^0.3.0",
|
|
94
|
-
"commitlint": "^
|
|
94
|
+
"commitlint": "^20.1.0",
|
|
95
95
|
"commitlint-plugin-cspell": "^0.3.0",
|
|
96
96
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
97
97
|
"cspell": "^9.2.1",
|
|
@@ -101,12 +101,12 @@
|
|
|
101
101
|
"eslint-plugin-import": "^2.32.0",
|
|
102
102
|
"husky": "^9.1.7",
|
|
103
103
|
"jsdom": "^27.0.0",
|
|
104
|
-
"lint-staged": "^16.
|
|
104
|
+
"lint-staged": "^16.2.3",
|
|
105
105
|
"prettier": "^3.6.2",
|
|
106
106
|
"rimraf": "^6.0.1",
|
|
107
|
-
"semantic-release": "^24.2.
|
|
107
|
+
"semantic-release": "^24.2.9",
|
|
108
108
|
"typescript": "^5.9.2",
|
|
109
|
-
"validate-package-exports": "^0.
|
|
109
|
+
"validate-package-exports": "^0.14.0",
|
|
110
110
|
"vitest": "^3.2.4"
|
|
111
111
|
},
|
|
112
112
|
"pnpm": {
|