akanjs 2.3.5-rc.10 → 2.3.5-rc.11
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/constant/serialize.ts +1 -1
- package/constant/via.ts +2 -4
- package/package.json +1 -1
- package/types/constant/via.d.ts +2 -2
package/constant/serialize.ts
CHANGED
|
@@ -35,7 +35,7 @@ const serializeInput = <Input = unknown>(
|
|
|
35
35
|
{ optional = false }: { optional?: boolean } = {},
|
|
36
36
|
): Input | Input[] => {
|
|
37
37
|
if (arrDepth && Array.isArray(value))
|
|
38
|
-
return value.map((v) => serializeInput(v, inputRef, arrDepth - 1) as Input) as unknown as Input[];
|
|
38
|
+
return value.map((v) => serializeInput(v, inputRef, arrDepth - 1, serializeType) as Input) as unknown as Input[];
|
|
39
39
|
else if ((inputRef as MapConstructor).prototype === Map.prototype) {
|
|
40
40
|
const [valueRef] = getNonArrayModel(inputRef as Cls);
|
|
41
41
|
const serializeFn = getSerializeFn(valueRef, { optional });
|
package/constant/via.ts
CHANGED
|
@@ -174,10 +174,8 @@ export interface ConstantStatics<Schema = any, FieldObj extends FieldObject = Fi
|
|
|
174
174
|
text: { search: Set<string>; filter: Set<string>; children: { search: Set<string>; filter: Set<string> } };
|
|
175
175
|
_DatabaseSchema: {
|
|
176
176
|
[K in keyof Schema]: K extends keyof FieldObj
|
|
177
|
-
? FieldObj[K] extends
|
|
178
|
-
?
|
|
179
|
-
? NonNullable<Schema[K]>
|
|
180
|
-
: Schema[K]
|
|
177
|
+
? FieldObj[K]["fieldType"] extends "hidden"
|
|
178
|
+
? NonNullable<Schema[K]>
|
|
181
179
|
: Schema[K]
|
|
182
180
|
: Schema[K];
|
|
183
181
|
};
|
package/package.json
CHANGED
package/types/constant/via.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Cls, type EnumInstance, FIELD_META, type MergeAllKeyOfObjects, type MergeAllTypes } from "akanjs/base";
|
|
2
|
-
import {
|
|
2
|
+
import { type ExtractFieldInfoObject, type FieldBuilder, type FieldInfoObject, type FieldInfoObjectToFieldObject, type FieldObject, type FieldResolver } from "./fieldInfo.d.ts";
|
|
3
3
|
import { type PurifyFunc } from "./purify.d.ts";
|
|
4
4
|
import type { BaseInsight, BaseObject, ConstantType, DefaultOf, NonFunctionalKeys } from "./types.d.ts";
|
|
5
5
|
type BaseFields = "id" | "createdAt" | "updatedAt" | "removedAt";
|
|
@@ -24,7 +24,7 @@ export interface ConstantStatics<Schema = any, FieldObj extends FieldObject = Fi
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
_DatabaseSchema: {
|
|
27
|
-
[K in keyof Schema]: K extends keyof FieldObj ? FieldObj[K] extends
|
|
27
|
+
[K in keyof Schema]: K extends keyof FieldObj ? FieldObj[K]["fieldType"] extends "hidden" ? NonNullable<Schema[K]> : Schema[K] : Schema[K];
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
export type ConstantCls<Schema = any, FieldObj extends FieldObject = FieldObject> = (new (obj?: Partial<Schema>) => Schema & ConstantMethods<Schema>) & ConstantStatics<Schema, FieldObj>;
|