@nmtjs/type 0.16.0-beta.7 → 0.16.0-beta.9
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/types/object.d.ts +2 -2
- package/package.json +3 -3
- package/src/types/object.ts +2 -2
package/dist/types/object.d.ts
CHANGED
|
@@ -29,11 +29,11 @@ export type ObjectLikeType<T extends ObjectTypeProps> = ObjectType<T> | LooseObj
|
|
|
29
29
|
export type AnyObjectType = ObjectType<ObjectTypeProps>;
|
|
30
30
|
export type AnyLooseObjectType = LooseObjectType<ObjectTypeProps>;
|
|
31
31
|
export type AnyObjectLikeType = AnyObjectType | AnyLooseObjectType;
|
|
32
|
-
export declare class RecordType<K extends LiteralType<string | number> | EnumType | StringType, E extends BaseType> extends BaseType<ZodMiniRecord<K['encodeZodType'], E['encodeZodType']>, ZodMiniRecord<K['decodeZodType'], E['decodeZodType']>, {
|
|
32
|
+
export declare class RecordType<K extends LiteralType<string | number> | EnumType<any> | StringType, E extends BaseType> extends BaseType<ZodMiniRecord<K['encodeZodType'], E['encodeZodType']>, ZodMiniRecord<K['decodeZodType'], E['decodeZodType']>, {
|
|
33
33
|
key: K;
|
|
34
34
|
element: E;
|
|
35
35
|
}> {
|
|
36
|
-
static factory<K extends LiteralType<string | number> | EnumType | StringType, E extends BaseType>(key: K, element: E): RecordType<K, E>;
|
|
36
|
+
static factory<K extends LiteralType<string | number> | EnumType<any> | StringType, E extends BaseType>(key: K, element: E): RecordType<K, E>;
|
|
37
37
|
}
|
|
38
38
|
export type KeyofType<T extends AnyObjectLikeType> = EnumType<core.util.ToEnum<Extract<keyof T['props']['properties'], string>>>;
|
|
39
39
|
export declare function keyof<T extends AnyObjectLikeType>(type: T): KeyofType<T>;
|
package/package.json
CHANGED
|
@@ -41,19 +41,19 @@
|
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"temporal-polyfill": "^0.3.2",
|
|
43
43
|
"zod": "^4.0.0",
|
|
44
|
-
"@nmtjs/common": "0.16.0-beta.
|
|
44
|
+
"@nmtjs/common": "0.16.0-beta.9"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"temporal-polyfill": "^0.3.2",
|
|
48
48
|
"zod": "^4.0.0",
|
|
49
|
-
"@nmtjs/common": "0.16.0-beta.
|
|
49
|
+
"@nmtjs/common": "0.16.0-beta.9"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"temporal-polyfill": {
|
|
53
53
|
"optional": true
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"version": "0.16.0-beta.
|
|
56
|
+
"version": "0.16.0-beta.9",
|
|
57
57
|
"scripts": {
|
|
58
58
|
"clean-build": "rm -rf ./dist"
|
|
59
59
|
}
|
package/src/types/object.ts
CHANGED
|
@@ -74,7 +74,7 @@ export type AnyLooseObjectType = LooseObjectType<ObjectTypeProps>
|
|
|
74
74
|
export type AnyObjectLikeType = AnyObjectType | AnyLooseObjectType
|
|
75
75
|
|
|
76
76
|
export class RecordType<
|
|
77
|
-
K extends LiteralType<string | number> | EnumType | StringType,
|
|
77
|
+
K extends LiteralType<string | number> | EnumType<any> | StringType,
|
|
78
78
|
E extends BaseType,
|
|
79
79
|
> extends BaseType<
|
|
80
80
|
ZodMiniRecord<K['encodeZodType'], E['encodeZodType']>,
|
|
@@ -82,7 +82,7 @@ export class RecordType<
|
|
|
82
82
|
{ key: K; element: E }
|
|
83
83
|
> {
|
|
84
84
|
static factory<
|
|
85
|
-
K extends LiteralType<string | number> | EnumType | StringType,
|
|
85
|
+
K extends LiteralType<string | number> | EnumType<any> | StringType,
|
|
86
86
|
E extends BaseType,
|
|
87
87
|
>(key: K, element: E) {
|
|
88
88
|
return new RecordType<K, E>({
|