@alessiofrittoli/type-utils 0.2.0 → 0.3.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/README.md +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/package.json +40 -41
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -3,8 +3,11 @@ declare class Stringified<T> extends String {
|
|
|
3
3
|
}
|
|
4
4
|
declare global {
|
|
5
5
|
interface JSON {
|
|
6
|
-
stringify<T>(value: T, replacer?: (
|
|
7
|
-
|
|
6
|
+
stringify<T>(value: T, replacer?: (this: {
|
|
7
|
+
'': T;
|
|
8
|
+
} | T, key: string, value: T) => any, space?: string | number): T extends Date ? string : string & Stringified<T>;
|
|
9
|
+
stringify<T>(value: T, replacer?: (T extends object ? (keyof T)[] : (number | string)[]) | null, space?: string | number): T extends Date ? string : string & Stringified<T>;
|
|
10
|
+
parse<T, U extends keyof T = keyof T>(text: string | Stringified<T>, reviver?: (key: U, value: T[U]) => any): T;
|
|
8
11
|
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
|
9
12
|
}
|
|
10
13
|
interface Body {
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,11 @@ declare class Stringified<T> extends String {
|
|
|
3
3
|
}
|
|
4
4
|
declare global {
|
|
5
5
|
interface JSON {
|
|
6
|
-
stringify<T>(value: T, replacer?: (
|
|
7
|
-
|
|
6
|
+
stringify<T>(value: T, replacer?: (this: {
|
|
7
|
+
'': T;
|
|
8
|
+
} | T, key: string, value: T) => any, space?: string | number): T extends Date ? string : string & Stringified<T>;
|
|
9
|
+
stringify<T>(value: T, replacer?: (T extends object ? (keyof T)[] : (number | string)[]) | null, space?: string | number): T extends Date ? string : string & Stringified<T>;
|
|
10
|
+
parse<T, U extends keyof T = keyof T>(text: string | Stringified<T>, reviver?: (key: U, value: T[U]) => any): T;
|
|
8
11
|
parse(text: string, reviver?: (key: any, value: any) => any): any;
|
|
9
12
|
}
|
|
10
13
|
interface Body {
|
package/package.json
CHANGED
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
2
|
+
"name": "@alessiofrittoli/type-utils",
|
|
3
|
+
"version": "0.3.1",
|
|
4
|
+
"description": "Lightweight TypeScript types utilities",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Alessio Frittoli",
|
|
7
|
+
"email": "info@alessiofrittoli.it",
|
|
8
|
+
"url": "https://alessiofrittoli.it"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"typescript"
|
|
13
|
+
],
|
|
14
|
+
"homepage": "https://github.com/alessiofrittoli/type-utils#readme",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/alessiofrittoli/type-utils/issues",
|
|
17
|
+
"email": "info@alessiofrittoli.it"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/alessiofrittoli/type-utils.git"
|
|
22
|
+
},
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist", "scripts"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "eslint && tsup",
|
|
30
|
+
"lint": "eslint",
|
|
31
|
+
"postinstall": "node scripts/postinstall/index.js"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@eslint/js": "^9.15.0",
|
|
35
|
+
"@types/node": "^22.10.0",
|
|
36
|
+
"eslint": "^9.15.0",
|
|
37
|
+
"globals": "^15.12.0",
|
|
38
|
+
"tsup": "^8.3.5",
|
|
39
|
+
"typescript": "^5.7.2",
|
|
40
|
+
"typescript-eslint": "^8.16.0"
|
|
41
|
+
}
|
|
43
42
|
}
|