Skip to content

Commit

Permalink
fix: πŸ› key type check doesn't work for Object.entires([])
Browse files Browse the repository at this point in the history
`Object.entires()` always yields string for number keys

βœ… Closes: #54
  • Loading branch information
mpyw committed Feb 21, 2023
1 parent 733b71b commit 98ae26d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axios-case-converter",
"version": "1.0.0",
"version": "1.0.1",
"main": "lib/index.js",
"module": "es/index.js",
"types": "typings/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const transformObjectUsingCallbackRecursive = (
if (isFormData(store) || isURLSearchParams(store)) {
store.append(fn(key as string), value as string & File);
} else if (key !== '__proto__') {
store[typeof key === 'number' ? key : fn(`${key}`)] =
store[Array.isArray(data) ? Number(key) : fn(`${key}`)] =
transformObjectUsingCallbackRecursive(value, fn, overwrite);
}
}
Expand Down

0 comments on commit 98ae26d

Please sign in to comment.