gg-express 1.0.31 → 1.0.32
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/GGExpress.d.ts +9 -13
- package/package.json +1 -1
- package/src/GGExpress.ts +4 -8
package/dist/GGExpress.d.ts
CHANGED
|
@@ -23,22 +23,18 @@ interface requireParamsStructure {
|
|
|
23
23
|
}
|
|
24
24
|
type numberOrString<T> = T extends "number" ? number : T extends "string" ? string : T extends string[] ? Unarray<T> : T extends number[] ? Unarray<T> : "error-type";
|
|
25
25
|
type singleOrArrayObject<DT extends requireParamsStructure["dataType"], T extends requireParamsStructure["structure"], K extends keyof T, P extends requireParamsStructure["parameter"]> = DT extends "arrayObject" ? {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
[Key in keyof P]: numberOrString<P[Key]>;
|
|
29
|
-
};
|
|
30
|
-
data: {
|
|
31
|
-
[Key in K]: numberOrString<T[Key]>;
|
|
32
|
-
}[];
|
|
26
|
+
parameter: {
|
|
27
|
+
[Key in keyof P]: numberOrString<P[Key]>;
|
|
33
28
|
};
|
|
29
|
+
data: {
|
|
30
|
+
[Key in K]: numberOrString<T[Key]>;
|
|
31
|
+
}[];
|
|
34
32
|
} : {
|
|
33
|
+
parameter: {
|
|
34
|
+
[Key in keyof P]: numberOrString<P[Key]>;
|
|
35
|
+
};
|
|
35
36
|
data: {
|
|
36
|
-
|
|
37
|
-
[Key in keyof P]: numberOrString<P[Key]>;
|
|
38
|
-
};
|
|
39
|
-
data: {
|
|
40
|
-
[Key in K]: numberOrString<T[Key]>;
|
|
41
|
-
};
|
|
37
|
+
[Key in K]: numberOrString<T[Key]>;
|
|
42
38
|
};
|
|
43
39
|
};
|
|
44
40
|
type MyRequest<DT extends requireParamsStructure["dataType"], T extends requireParamsStructure["structure"], K extends keyof T, P extends requireParamsStructure["parameter"]> = Request<{}, {}, singleOrArrayObject<DT, T, K, P>, singleOrArrayObject<DT, T, K, P>, {}>;
|
package/package.json
CHANGED
package/src/GGExpress.ts
CHANGED
|
@@ -45,16 +45,12 @@ type singleOrArrayObject<
|
|
|
45
45
|
P extends requireParamsStructure["parameter"]
|
|
46
46
|
> = DT extends "arrayObject"
|
|
47
47
|
? {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
data: { [Key in K]: numberOrString<T[Key]> }[]
|
|
51
|
-
}
|
|
48
|
+
parameter: { [Key in keyof P]: numberOrString<P[Key]> }
|
|
49
|
+
data: { [Key in K]: numberOrString<T[Key]> }[]
|
|
52
50
|
}
|
|
53
51
|
: {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
data: { [Key in K]: numberOrString<T[Key]> }
|
|
57
|
-
}
|
|
52
|
+
parameter: { [Key in keyof P]: numberOrString<P[Key]> }
|
|
53
|
+
data: { [Key in K]: numberOrString<T[Key]> }
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
type MyRequest<
|