@colyseus/schema 2.0.23 → 2.0.24
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.
|
@@ -7,5 +7,5 @@ export type NonFunctionPropNames<T> = {
|
|
|
7
7
|
[K in keyof T]: T[K] extends Function ? never : K;
|
|
8
8
|
}[keyof T];
|
|
9
9
|
export type ToJSON<T> = NonFunctionProps<{
|
|
10
|
-
[K in keyof T]: T[K] extends MapSchema<infer U> ? Record<string, U> : T[K] extends ArraySchema<infer U> ? U[] : T[K];
|
|
10
|
+
[K in keyof T]: T[K] extends MapSchema<infer U> ? Record<string, U> : T[K] extends Map<string, infer U> ? Record<string, U> : T[K] extends ArraySchema<infer U> ? U[] : T[K];
|
|
11
11
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelperTypes.js","sourceRoot":"","sources":["../../src/types/HelperTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { ArraySchema } from \"./ArraySchema\";\nimport { MapSchema } from \"./MapSchema\";\n\nexport type NonFunctionProps<T> = Omit<T, {\n [K in keyof T]: T[K] extends Function ? K : never;\n}[keyof T]>;\n\nexport type NonFunctionPropNames<T> = {\n [K in keyof T]: T[K] extends Function ? never : K\n}[keyof T];\n\nexport type ToJSON<T> = NonFunctionProps<{\n [K in keyof T]: T[K] extends MapSchema<infer U>\n ? Record<string, U>\n : T[K] extends
|
|
1
|
+
{"version":3,"file":"HelperTypes.js","sourceRoot":"","sources":["../../src/types/HelperTypes.ts"],"names":[],"mappings":"","sourcesContent":["import { ArraySchema } from \"./ArraySchema\";\nimport { MapSchema } from \"./MapSchema\";\n\nexport type NonFunctionProps<T> = Omit<T, {\n [K in keyof T]: T[K] extends Function ? K : never;\n}[keyof T]>;\n\nexport type NonFunctionPropNames<T> = {\n [K in keyof T]: T[K] extends Function ? never : K\n}[keyof T];\n\nexport type ToJSON<T> = NonFunctionProps<{\n [K in keyof T]: T[K] extends MapSchema<infer U>\n ? Record<string, U>\n : T[K] extends Map<string, infer U>\n ? Record<string, U>\n : T[K] extends ArraySchema<infer U>\n ? U[]\n : T[K]\n}>;"]}
|
package/package.json
CHANGED
package/src/types/HelperTypes.ts
CHANGED
|
@@ -12,7 +12,9 @@ export type NonFunctionPropNames<T> = {
|
|
|
12
12
|
export type ToJSON<T> = NonFunctionProps<{
|
|
13
13
|
[K in keyof T]: T[K] extends MapSchema<infer U>
|
|
14
14
|
? Record<string, U>
|
|
15
|
-
: T[K] extends
|
|
16
|
-
? U
|
|
17
|
-
: T[K]
|
|
15
|
+
: T[K] extends Map<string, infer U>
|
|
16
|
+
? Record<string, U>
|
|
17
|
+
: T[K] extends ArraySchema<infer U>
|
|
18
|
+
? U[]
|
|
19
|
+
: T[K]
|
|
18
20
|
}>;
|