quidproquo-webserver 0.1.22 → 0.1.24

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.
@@ -5,9 +5,12 @@ const urlPathLength = (path) => {
5
5
  return path.replace(/\{[^}]+\}/g, '').length;
6
6
  };
7
7
  exports.urlPathLength = urlPathLength;
8
+ // Most specific first: the longest static (param-stripped) path wins, so `/packs/build` is tried
9
+ // before `/packs/{id}` and a literal segment is never swallowed by a sibling's parameter. The matcher
10
+ // takes the first match in this order.
8
11
  const sortPathMatchConfigs = (objects) => {
9
12
  return [...objects].sort((a, b) => {
10
- return (0, exports.urlPathLength)(a.path) - (0, exports.urlPathLength)(b.path);
13
+ return (0, exports.urlPathLength)(b.path) - (0, exports.urlPathLength)(a.path);
11
14
  });
12
15
  };
13
16
  exports.sortPathMatchConfigs = sortPathMatchConfigs;
@@ -1 +1 @@
1
- {"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../../../src/utils/pathUtils.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAMK,MAAM,oBAAoB,GAAG,CAAuB,OAAY,EAAO,EAAE;IAC9E,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,OAAO,IAAA,qBAAa,EAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAa,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B","sourcesContent":["export const urlPathLength = (path: string) => {\n return path.replace(/\\{[^}]+\\}/g, '').length;\n};\n\ninterface PathObject {\n path: string;\n}\n\nexport const sortPathMatchConfigs = <T extends PathObject>(objects: T[]): T[] => {\n return [...objects].sort((a, b) => {\n return urlPathLength(a.path) - urlPathLength(b.path);\n });\n};\n"]}
1
+ {"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../../../src/utils/pathUtils.ts"],"names":[],"mappings":";;;AAAO,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC,CAAC;AAFW,QAAA,aAAa,iBAExB;AAMF,iGAAiG;AACjG,sGAAsG;AACtG,uCAAuC;AAChC,MAAM,oBAAoB,GAAG,CAAuB,OAAY,EAAO,EAAE;IAC9E,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,OAAO,IAAA,qBAAa,EAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAA,qBAAa,EAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAJW,QAAA,oBAAoB,wBAI/B","sourcesContent":["export const urlPathLength = (path: string) => {\n return path.replace(/\\{[^}]+\\}/g, '').length;\n};\n\ninterface PathObject {\n path: string;\n}\n\n// Most specific first: the longest static (param-stripped) path wins, so `/packs/build` is tried\n// before `/packs/{id}` and a literal segment is never swallowed by a sibling's parameter. The matcher\n// takes the first match in this order.\nexport const sortPathMatchConfigs = <T extends PathObject>(objects: T[]): T[] => {\n return [...objects].sort((a, b) => {\n return urlPathLength(b.path) - urlPathLength(a.path);\n });\n};\n"]}
@@ -1,9 +1,12 @@
1
1
  export const urlPathLength = (path) => {
2
2
  return path.replace(/\{[^}]+\}/g, '').length;
3
3
  };
4
+ // Most specific first: the longest static (param-stripped) path wins, so `/packs/build` is tried
5
+ // before `/packs/{id}` and a literal segment is never swallowed by a sibling's parameter. The matcher
6
+ // takes the first match in this order.
4
7
  export const sortPathMatchConfigs = (objects) => {
5
8
  return [...objects].sort((a, b) => {
6
- return urlPathLength(a.path) - urlPathLength(b.path);
9
+ return urlPathLength(b.path) - urlPathLength(a.path);
7
10
  });
8
11
  };
9
12
  //# sourceMappingURL=pathUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../../../src/utils/pathUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC,CAAC;AAMF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAuB,OAAY,EAAO,EAAE;IAC9E,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["export const urlPathLength = (path: string) => {\n return path.replace(/\\{[^}]+\\}/g, '').length;\n};\n\ninterface PathObject {\n path: string;\n}\n\nexport const sortPathMatchConfigs = <T extends PathObject>(objects: T[]): T[] => {\n return [...objects].sort((a, b) => {\n return urlPathLength(a.path) - urlPathLength(b.path);\n });\n};\n"]}
1
+ {"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../../../src/utils/pathUtils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAC/C,CAAC,CAAC;AAMF,iGAAiG;AACjG,sGAAsG;AACtG,uCAAuC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAuB,OAAY,EAAO,EAAE;IAC9E,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAChC,OAAO,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["export const urlPathLength = (path: string) => {\n return path.replace(/\\{[^}]+\\}/g, '').length;\n};\n\ninterface PathObject {\n path: string;\n}\n\n// Most specific first: the longest static (param-stripped) path wins, so `/packs/build` is tried\n// before `/packs/{id}` and a literal segment is never swallowed by a sibling's parameter. The matcher\n// takes the first match in this order.\nexport const sortPathMatchConfigs = <T extends PathObject>(objects: T[]): T[] => {\n return [...objects].sort((a, b) => {\n return urlPathLength(b.path) - urlPathLength(a.path);\n });\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-webserver",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -35,10 +35,10 @@
35
35
  },
36
36
  "homepage": "https://github.com/qpqjs/quidproquo#readme",
37
37
  "dependencies": {
38
- "quidproquo-core": "0.1.22"
38
+ "quidproquo-core": "0.1.24"
39
39
  },
40
40
  "devDependencies": {
41
- "quidproquo-tsconfig": "0.1.22",
41
+ "quidproquo-tsconfig": "0.1.24",
42
42
  "typescript": "^5.8.2"
43
43
  }
44
44
  }