From 6a62b24d39d97503da66733e4537699fa94a87e7 Mon Sep 17 00:00:00 2001 From: titanism <101466223+titanism@users.noreply.github.com> Date: Wed, 3 Jul 2024 20:53:57 -0500 Subject: [PATCH] fix: fixed RangeError: Too many properties to enumerate --- package.json | 18 +++++++++--------- src/index.js | 5 +++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 80d7e51..53543b8 100644 --- a/package.json +++ b/package.json @@ -32,9 +32,9 @@ "unset-value": "2.0.1" }, "devDependencies": { - "@babel/cli": "^7.24.1", - "@babel/core": "^7.24.4", - "@babel/preset-env": "^7.24.4", + "@babel/cli": "^7.24.7", + "@babel/core": "^7.24.7", + "@babel/preset-env": "^7.24.7", "@commitlint/cli": "^19.3.0", "@commitlint/config-conventional": "^19.2.2", "ava": "5.3.1", @@ -49,19 +49,19 @@ "express": "^4.19.2", "fixpack": "^4.0.0", "husky": "^9.0.11", - "jsdom": "15.x", + "jsdom": "15", "koa": "^2.15.3", - "lint-staged": "^15.2.2", + "lint-staged": "^15.2.7", "lodash": "^4.17.21", - "nyc": "^15.1.0", - "pino": "^9.0.0", + "nyc": "^17.0.0", + "pino": "^9.2.0", "remark-cli": "11.0.0", "remark-preset-github": "^4.0.4", "rimraf": "^5.0.5", "signale": "^1.4.0", - "sinon": "^17.0.1", + "sinon": "^18.0.0", "tinyify": "3.0.0", - "tsd": "^0.31.0", + "tsd": "^0.31.1", "xo": "0.56.0" }, "engines": { diff --git a/src/index.js b/src/index.js index 95298a0..780bacf 100644 --- a/src/index.js +++ b/src/index.js @@ -49,6 +49,11 @@ function isPlainObject(value) { function dotifyToArray(obj) { const res = []; function recurse(obj, current) { + // if it's a buffer, uint8array, or array + // eslint-disable-next-line n/prefer-global/buffer + if (Buffer.isBuffer(obj) || obj instanceof Uint8Array || Array.isArray(obj)) + return; + for (const key of Reflect.ownKeys(obj)) { const value = obj[key]; const convertedKey = isSymbol(key)