counterfact 0.45.1 → 0.45.2

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.
@@ -13,12 +13,22 @@ export class ContextRegistry {
13
13
  constructor() {
14
14
  this.add("/", {});
15
15
  }
16
+ getContextIgnoreCase(map, key) {
17
+ const lowerCaseKey = key.toLowerCase();
18
+ for (const currentKey of map.keys()) {
19
+ if (currentKey.toLowerCase() === lowerCaseKey) {
20
+ return map.get(currentKey);
21
+ }
22
+ }
23
+ return undefined;
24
+ }
16
25
  add(path, context) {
17
26
  this.entries.set(path, context);
18
27
  this.cache.set(path, structuredClone(context));
19
28
  }
20
29
  find(path) {
21
- return this.entries.get(path) ?? this.find(parentPath(path));
30
+ return (this.getContextIgnoreCase(this.entries, path) ??
31
+ this.find(parentPath(path)));
22
32
  }
23
33
  // eslint-disable-next-line max-statements
24
34
  update(path, updatedContext) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "counterfact",
3
- "version": "0.45.1",
3
+ "version": "0.45.2",
4
4
  "description": "a library for building a fake REST API for testing",
5
5
  "type": "module",
6
6
  "main": "./src/server/counterfact.js",
@@ -48,7 +48,7 @@
48
48
  "@stryker-mutator/core": "8.2.6",
49
49
  "@stryker-mutator/jest-runner": "8.2.6",
50
50
  "@stryker-mutator/typescript-checker": "8.2.6",
51
- "@swc/core": "1.5.24",
51
+ "@swc/core": "1.6.3",
52
52
  "@swc/jest": "0.2.36",
53
53
  "@testing-library/dom": "10.1.0",
54
54
  "@types/jest": "29.5.12",
@@ -65,14 +65,14 @@
65
65
  "eslint-plugin-etc": "2.0.3",
66
66
  "eslint-plugin-file-progress": "1.4.0",
67
67
  "eslint-plugin-import": "2.29.1",
68
- "eslint-plugin-jest": "28.5.0",
68
+ "eslint-plugin-jest": "28.6.0",
69
69
  "eslint-plugin-jest-dom": "5.4.0",
70
70
  "eslint-plugin-no-explicit-type-exports": "0.12.1",
71
71
  "eslint-plugin-unused-imports": "4.0.0",
72
72
  "husky": "9.0.11",
73
73
  "jest": "29.7.0",
74
- "node-mocks-http": "1.14.1",
75
- "nodemon": "3.1.2",
74
+ "node-mocks-http": "1.15.0",
75
+ "nodemon": "3.1.4",
76
76
  "rimraf": "5.0.7",
77
77
  "stryker-cli": "1.0.2",
78
78
  "supertest": "7.0.0",
@@ -101,7 +101,7 @@
101
101
  "open": "10.1.0",
102
102
  "patch-package": "8.0.0",
103
103
  "precinct": "12.1.1",
104
- "prettier": "3.3.0",
104
+ "prettier": "3.3.2",
105
105
  "recast": "0.23.9",
106
106
  "typescript": "5.4.5"
107
107
  }