@netlify/redirect-matcher 0.4.0 → 0.4.1
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.
- package/index.js +8 -4
- package/matcher.wasm +0 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -37,11 +37,15 @@ const stringRecord = (record, name, normalizeKey) => {
|
|
|
37
37
|
}
|
|
38
38
|
let entries
|
|
39
39
|
if (record !== null && typeof record === 'object') {
|
|
40
|
-
|
|
41
|
-
if (proto === Object.prototype || proto === null) {
|
|
42
|
-
entries = Object.entries(record)
|
|
43
|
-
} else if (typeof record[Symbol.iterator] === 'function') {
|
|
40
|
+
if (typeof record[Symbol.iterator] === 'function') {
|
|
44
41
|
entries = record
|
|
42
|
+
} else {
|
|
43
|
+
// Dictionaries built on a constructor-less prototype, like the ones
|
|
44
|
+
// `cookie` returns, count as plain; class instances such as URL do not.
|
|
45
|
+
const constructor = Object.getPrototypeOf(record)?.constructor
|
|
46
|
+
if (constructor === undefined || constructor === Object) {
|
|
47
|
+
entries = Object.entries(record)
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
if (entries === undefined) {
|
package/matcher.wasm
CHANGED
|
Binary file
|