@tsed/schema 6.125.2 → 6.125.3

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,22 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.concatPath = void 0;
4
4
  function concatPath(basePath, path) {
5
- return ((basePath || "") + (path || "")).replace(/\/\//gi, "/");
5
+ if (basePath instanceof RegExp || path instanceof RegExp) {
6
+ if (!basePath) {
7
+ return path;
8
+ }
9
+ if (!path) {
10
+ return basePath;
11
+ }
12
+ const r1 = basePath instanceof RegExp ? basePath : new RegExp(basePath, "gi");
13
+ const r2 = path instanceof RegExp ? path : new RegExp(path, "gi");
14
+ return new RegExp(r1.source + r2.source, (r1.global ? "g" : "") + (r1.ignoreCase ? "i" : "") + (r1.multiline ? "m" : ""));
15
+ }
16
+ if (basePath && path && basePath.endsWith("/") && path.startsWith("/")) {
17
+ path = path.slice(1);
18
+ }
19
+ const result = (basePath || "") + (path || "");
20
+ return result.endsWith("/") && result.length > 1 ? result.slice(0, -1) : result;
6
21
  }
7
22
  exports.concatPath = concatPath;
8
23
  //# sourceMappingURL=concatPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"concatPath.js","sourceRoot":"","sources":["../../../src/utils/concatPath.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,QAA4B,EAAE,IAAwB;IAC/E,OAAO,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAClE,CAAC;AAFD,gCAEC","sourcesContent":["export function concatPath(basePath: string | undefined, path: string | undefined): string {\n return ((basePath || \"\") + (path || \"\")).replace(/\\/\\//gi, \"/\");\n}\n"]}
1
+ {"version":3,"file":"concatPath.js","sourceRoot":"","sources":["../../../src/utils/concatPath.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAA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C,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAClF,CAAC;AAvBD,gCAuBC","sourcesContent":["export function concatPath(basePath: string | undefined | RegExp, path: string | undefined | RegExp): any {\n if (basePath instanceof RegExp || path instanceof RegExp) {\n if (!basePath) {\n return path;\n }\n\n if (!path) {\n return basePath;\n }\n\n const r1 = basePath instanceof RegExp ? basePath : new RegExp(basePath, \"gi\");\n const r2 = path instanceof RegExp ? path : new RegExp(path, \"gi\");\n\n return new RegExp(r1.source + r2.source, (r1.global ? \"g\" : \"\") + (r1.ignoreCase ? \"i\" : \"\") + (r1.multiline ? \"m\" : \"\"));\n }\n\n if (basePath && path && basePath.endsWith(\"/\") && path.startsWith(\"/\")) {\n path = path.slice(1);\n }\n\n const result = (basePath || \"\") + (path || \"\");\n\n return result.endsWith(\"/\") && result.length > 1 ? result.slice(0, -1) : result;\n}\n"]}
@@ -1,4 +1,19 @@
1
1
  export function concatPath(basePath, path) {
2
- return ((basePath || "") + (path || "")).replace(/\/\//gi, "/");
2
+ if (basePath instanceof RegExp || path instanceof RegExp) {
3
+ if (!basePath) {
4
+ return path;
5
+ }
6
+ if (!path) {
7
+ return basePath;
8
+ }
9
+ const r1 = basePath instanceof RegExp ? basePath : new RegExp(basePath, "gi");
10
+ const r2 = path instanceof RegExp ? path : new RegExp(path, "gi");
11
+ return new RegExp(r1.source + r2.source, (r1.global ? "g" : "") + (r1.ignoreCase ? "i" : "") + (r1.multiline ? "m" : ""));
12
+ }
13
+ if (basePath && path && basePath.endsWith("/") && path.startsWith("/")) {
14
+ path = path.slice(1);
15
+ }
16
+ const result = (basePath || "") + (path || "");
17
+ return result.endsWith("/") && result.length > 1 ? result.slice(0, -1) : result;
3
18
  }
4
19
  //# sourceMappingURL=concatPath.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"concatPath.js","sourceRoot":"","sources":["../../../src/utils/concatPath.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,QAA4B,EAAE,IAAwB;IAC/E,OAAO,CAAC,CAAC,QAAQ,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAClE,CAAC","sourcesContent":["export function concatPath(basePath: string | undefined, path: string | undefined): string {\n return ((basePath || \"\") + (path || \"\")).replace(/\\/\\//gi, \"/\");\n}\n"]}
1
+ {"version":3,"file":"concatPath.js","sourceRoot":"","sources":["../../../src/utils/concatPath.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,QAAqC,EAAE,IAAiC;IACjG,IAAI,QAAQ,YAAY,MAAM,IAAI,IAAI,YAAY,MAAM,EAAE;QACxD,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,IAAI,CAAC;SACb;QAED,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,QAAQ,CAAC;SACjB;QAED,MAAM,EAAE,GAAG,QAAQ,YAAY,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC9E,MAAM,EAAE,GAAG,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAElE,OAAO,IAAI,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KAC3H;IAED,IAAI,QAAQ,IAAI,IAAI,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACtE,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACtB;IAED,MAAM,MAAM,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAE/C,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAClF,CAAC","sourcesContent":["export function concatPath(basePath: string | undefined | RegExp, path: string | undefined | RegExp): any {\n if (basePath instanceof RegExp || path instanceof RegExp) {\n if (!basePath) {\n return path;\n }\n\n if (!path) {\n return basePath;\n }\n\n const r1 = basePath instanceof RegExp ? basePath : new RegExp(basePath, \"gi\");\n const r2 = path instanceof RegExp ? path : new RegExp(path, \"gi\");\n\n return new RegExp(r1.source + r2.source, (r1.global ? \"g\" : \"\") + (r1.ignoreCase ? \"i\" : \"\") + (r1.multiline ? \"m\" : \"\"));\n }\n\n if (basePath && path && basePath.endsWith(\"/\") && path.startsWith(\"/\")) {\n path = path.slice(1);\n }\n\n const result = (basePath || \"\") + (path || \"\");\n\n return result.endsWith(\"/\") && result.length > 1 ? result.slice(0, -1) : result;\n}\n"]}
@@ -8,9 +8,9 @@ export declare class JsonOperationRoute<Entity extends JsonMethodStore = JsonMet
8
8
  readonly basePath?: string;
9
9
  readonly paramsTypes: Record<string, boolean>;
10
10
  constructor(options: Partial<JsonOperationRoute>);
11
- get url(): string;
11
+ get url(): any;
12
12
  get path(): string | RegExp | undefined;
13
- get fullPath(): string;
13
+ get fullPath(): any;
14
14
  get method(): string;
15
15
  get isFinal(): boolean;
16
16
  get name(): string;
@@ -1 +1 @@
1
- export declare function concatPath(basePath: string | undefined, path: string | undefined): string;
1
+ export declare function concatPath(basePath: string | undefined | RegExp, path: string | undefined | RegExp): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/schema",
3
- "version": "6.125.2",
3
+ "version": "6.125.3",
4
4
  "description": "JsonSchema module for Ts.ED Framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -32,7 +32,7 @@
32
32
  "tsed"
33
33
  ],
34
34
  "dependencies": {
35
- "@tsed/openspec": "6.125.2",
35
+ "@tsed/openspec": "6.125.3",
36
36
  "change-case": "^4.1.2",
37
37
  "fs-extra": "^10.0.1",
38
38
  "json-schema": "0.4.0",
@@ -42,8 +42,8 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@apidevtools/swagger-parser": "10.0.3",
45
- "@tsed/core": "6.125.2",
46
- "@tsed/openspec": "6.125.2",
45
+ "@tsed/core": "6.125.3",
46
+ "@tsed/openspec": "6.125.3",
47
47
  "@types/fs-extra": "9.0.13",
48
48
  "@types/json-schema": "7.0.11",
49
49
  "@types/micromatch": "4.0.2",
@@ -51,8 +51,8 @@
51
51
  "api-spec-converter": "2.12.0"
52
52
  },
53
53
  "peerDependencies": {
54
- "@tsed/core": "^6.125.2",
55
- "@tsed/openspec": "^6.125.2"
54
+ "@tsed/core": "^6.125.3",
55
+ "@tsed/openspec": "^6.125.3"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "@tsed/openspec": {