@ddd-ts/freeze 0.0.0-fix-get-handler.2 → 0.0.0-fix-tied-cursor-projector.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-pretty-type.d.ts","sourceRoot":"","sources":["../../src/utils/get-pretty-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAe,IAAI,EAAE,MAAM,UAAU,CAAC;AAEzE,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,GAAG;IAC5D,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,oBAAoB,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,
|
|
1
|
+
{"version":3,"file":"get-pretty-type.d.ts","sourceRoot":"","sources":["../../src/utils/get-pretty-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAe,IAAI,EAAE,MAAM,UAAU,CAAC;AAEzE,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,GAAG;IAC5D,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,oBAAoB,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAmCA"}
|
|
@@ -7,34 +7,11 @@ function getPrettyType(type, contextNode) {
|
|
|
7
7
|
const typeTextForEmbedding = project.getTypeChecker().compilerObject.typeToString(type.compilerType, void 0, ts_morph.ts.TypeFormatFlags.NoTruncation | ts_morph.ts.TypeFormatFlags.UseFullyQualifiedType | ts_morph.ts.TypeFormatFlags.InTypeAlias);
|
|
8
8
|
const fileName = `__pretty_${Date.now()}_${Math.random().toString(16).slice(2)}.ts`;
|
|
9
9
|
const sf = project.createSourceFile(fileName, `
|
|
10
|
-
type
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
| string
|
|
16
|
-
| number
|
|
17
|
-
| boolean
|
|
18
|
-
| symbol
|
|
19
|
-
| bigint;
|
|
20
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
21
|
-
type BuiltIns = Primitive | void | Date | RegExp;
|
|
22
|
-
type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown) | Promise<unknown>;
|
|
23
|
-
type IsPlainObject<T> =
|
|
24
|
-
IsNever<T> extends true
|
|
25
|
-
? false
|
|
26
|
-
: T extends NonRecursiveType | MapsSetsOrArrays
|
|
27
|
-
? false
|
|
28
|
-
: T extends object
|
|
29
|
-
? true
|
|
30
|
-
: false;
|
|
31
|
-
// the code above is from type-fest. it's an extract of the IsPlainObject type with all the dependencies it has
|
|
32
|
-
|
|
33
|
-
type DeepPretty<T> = IsPlainObject<T> extends true
|
|
34
|
-
? { [K in keyof T]: DeepPretty<T[K]> } & {}
|
|
35
|
-
: T extends (infer U)[]
|
|
36
|
-
? DeepPretty<U>[] & {}
|
|
37
|
-
: T;
|
|
10
|
+
type DeepPretty<T> = T extends object
|
|
11
|
+
? T extends Function
|
|
12
|
+
? T
|
|
13
|
+
: { [K in keyof T]: DeepPretty<T[K]> } & {}
|
|
14
|
+
: T;
|
|
38
15
|
declare const __v: ${typeTextForEmbedding};
|
|
39
16
|
export type __X = DeepPretty<typeof __v>;
|
|
40
17
|
`, { overwrite: true });
|
|
@@ -6,34 +6,11 @@ function getPrettyType(type, contextNode) {
|
|
|
6
6
|
const typeTextForEmbedding = project.getTypeChecker().compilerObject.typeToString(type.compilerType, void 0, ts.TypeFormatFlags.NoTruncation | ts.TypeFormatFlags.UseFullyQualifiedType | ts.TypeFormatFlags.InTypeAlias);
|
|
7
7
|
const fileName = `__pretty_${Date.now()}_${Math.random().toString(16).slice(2)}.ts`;
|
|
8
8
|
const sf = project.createSourceFile(fileName, `
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
| string
|
|
15
|
-
| number
|
|
16
|
-
| boolean
|
|
17
|
-
| symbol
|
|
18
|
-
| bigint;
|
|
19
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
20
|
-
type BuiltIns = Primitive | void | Date | RegExp;
|
|
21
|
-
type NonRecursiveType = BuiltIns | Function | (new (...arguments_: any[]) => unknown) | Promise<unknown>;
|
|
22
|
-
type IsPlainObject<T> =
|
|
23
|
-
IsNever<T> extends true
|
|
24
|
-
? false
|
|
25
|
-
: T extends NonRecursiveType | MapsSetsOrArrays
|
|
26
|
-
? false
|
|
27
|
-
: T extends object
|
|
28
|
-
? true
|
|
29
|
-
: false;
|
|
30
|
-
// the code above is from type-fest. it's an extract of the IsPlainObject type with all the dependencies it has
|
|
31
|
-
|
|
32
|
-
type DeepPretty<T> = IsPlainObject<T> extends true
|
|
33
|
-
? { [K in keyof T]: DeepPretty<T[K]> } & {}
|
|
34
|
-
: T extends (infer U)[]
|
|
35
|
-
? DeepPretty<U>[] & {}
|
|
36
|
-
: T;
|
|
9
|
+
type DeepPretty<T> = T extends object
|
|
10
|
+
? T extends Function
|
|
11
|
+
? T
|
|
12
|
+
: { [K in keyof T]: DeepPretty<T[K]> } & {}
|
|
13
|
+
: T;
|
|
37
14
|
declare const __v: ${typeTextForEmbedding};
|
|
38
15
|
export type __X = DeepPretty<typeof __v>;
|
|
39
16
|
`, { overwrite: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts/freeze",
|
|
3
|
-
"version": "0.0.0-fix-
|
|
3
|
+
"version": "0.0.0-fix-tied-cursor-projector.2",
|
|
4
4
|
"types": "dist/index.d.ts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"typescript": "^5.5.4"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ddd-ts/core": "0.0.0-fix-
|
|
21
|
-
"@ddd-ts/shape": "0.0.0-fix-
|
|
22
|
-
"@ddd-ts/traits": "0.0.0-fix-
|
|
23
|
-
"@ddd-ts/types": "0.0.0-fix-
|
|
20
|
+
"@ddd-ts/core": "0.0.0-fix-tied-cursor-projector.2",
|
|
21
|
+
"@ddd-ts/shape": "0.0.0-fix-tied-cursor-projector.2",
|
|
22
|
+
"@ddd-ts/traits": "0.0.0-fix-tied-cursor-projector.2",
|
|
23
|
+
"@ddd-ts/types": "0.0.0-fix-tied-cursor-projector.2",
|
|
24
24
|
"@prettier/sync": "^0.6.1",
|
|
25
25
|
"prettier": "^3.8.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@ddd-ts/tools": "0.0.0-fix-
|
|
28
|
+
"@ddd-ts/tools": "0.0.0-fix-tied-cursor-projector.2",
|
|
29
29
|
"@types/jest": "^29.5.1",
|
|
30
30
|
"@types/node": "^22.14.1"
|
|
31
31
|
},
|