You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(spec): the driver-config registry refuses an off-vocabulary id instead of answering with a truthy non-schema
6
+
7
+
`DRIVER_CONFIG_JSON_SCHEMAS`, `DRIVER_ID_ALIASES` and `DATABASE_DRIVER_ALIASES`
8
+
are plain object literals, so all three inherit `Object.prototype`, and every
9
+
lookup into them was a bare index. Measured against the built artifact
10
+
(`dist/data/index.mjs`) on the repo's Node 22 baseline (v22.22.2), an id that
11
+
names an inherited member resolved that member and was handed onward as if it
12
+
were a driver:
13
+
14
+
| call | before | after |
15
+
|:--|:--|:--|
16
+
|`getDriverConfigJsonSchemaById('memory')`| the JSON Schema | the JSON Schema — unmoved |
17
+
|`getDriverConfigJsonSchemaById('constructor')`|`{}` — an EMPTY JSON Schema that accepts every config |`TypeError` naming the id and the legal vocabulary |
18
+
|`getDriverConfigJsonSchemaById('toString')`|`'[object Object]'` — a **string**, where the signature promises an object |`TypeError`|
19
+
|`getDriverConfigJsonSchemaById('valueOf')`| the registry object itself |`TypeError`|
20
+
|`getDriverConfigJsonSchemaById('__proto__')`|`TypeError: … is not a function`|`TypeError`, now naming the id |
21
+
|`getDriverConfigJsonSchemaById('nope')`|`TypeError: … is not a function`|`TypeError`, now naming the id |
22
+
|`resolveDriverId('constructor')`| the `Object`**function** — truthy, not a driver id |`undefined`|
23
+
|`resolveDriverId('__proto__')`|`Object.prototype` — a truthy object |`undefined`|
24
+
|`resolveDatabaseDriverId('constructor')`| the `Object`**function**|`undefined`|
25
+
|`driverHasLocalDefault('constructor')`|`undefined`, out of a function declared `boolean`|`true`, as its doc promises for an unknown id |
0 commit comments