Skip to content

Commit

Permalink
Prohibit prototype pollution in dexie-cloud-common
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Apr 27, 2022
1 parent 7e03b78 commit ad18b19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/dexie-cloud-common/src/utils.ts
Expand Up @@ -37,7 +37,7 @@ export function setByKeyPath(
//@ts-ignore: even if currentKeyPath would be numeric string and obj would be array - it works.
var innerObj = obj[currentKeyPath];
//@ts-ignore: even if currentKeyPath would be numeric string and obj would be array - it works.
if (!innerObj) innerObj = obj[currentKeyPath] = {};
if (!innerObj || !hasOwn(obj, currentKeyPath)) innerObj = (obj[currentKeyPath] = {});
setByKeyPath(innerObj, remainingKeyPath, value);
}
} else {
Expand Down

0 comments on commit ad18b19

Please sign in to comment.