gg-express 1.0.35 → 1.0.36

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.
@@ -2,7 +2,7 @@ import { NextFunction, Request, Response } from "express";
2
2
  import Express from "express-serve-static-core";
3
3
  type Unarray<T> = T extends (infer U)[] ? U : T;
4
4
  type AsConstArray<T extends readonly any[]> = [...T];
5
- type paramType = "number" | "string" | AsConstArray<Array<string>> | AsConstArray<Array<number>>;
5
+ type paramType = "number" | "string" | "any" | AsConstArray<Array<string>> | AsConstArray<Array<number>>;
6
6
  interface responseStructure {
7
7
  parameter: {
8
8
  [key: string]: "number" | "string";
@@ -21,7 +21,7 @@ interface requireParamsStructure {
21
21
  [key: string]: paramType;
22
22
  };
23
23
  }
24
- type numberOrString<T> = T extends "number" ? number : T extends "string" ? string : T extends string[] ? Unarray<T> : T extends number[] ? Unarray<T> : "error-type";
24
+ type numberOrString<T> = T extends "number" ? number : T extends "string" ? string : T extends "any" ? any : 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
26
  data: {
27
27
  parameter: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gg-express",
3
- "version": "1.0.35",
3
+ "version": "1.0.36",
4
4
  "description": "",
5
5
  "main": "dist/GGExpress.js",
6
6
  "scripts": {
package/src/GGExpress.ts CHANGED
@@ -11,6 +11,7 @@ type AsConstArray<T extends readonly any[]> = [...T]
11
11
  type paramType =
12
12
  | "number"
13
13
  | "string"
14
+ | "any"
14
15
  | AsConstArray<Array<string>>
15
16
  | AsConstArray<Array<number>>
16
17
  interface responseStructure {
@@ -32,6 +33,8 @@ type numberOrString<T> = T extends "number"
32
33
  ? number
33
34
  : T extends "string"
34
35
  ? string
36
+ : T extends "any"
37
+ ? any
35
38
  : T extends string[]
36
39
  ? Unarray<T>
37
40
  : T extends number[]