Skip to content

Commit

Permalink
fix: deepmergeInto unsafe key value assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed May 20, 2024
1 parent b40278f commit 6b04863
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion src/defaults/into.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function mergeRecords<
);

if (key === "__proto__") {
Object.defineProperty(m_target, key, {
Object.defineProperty(m_target.value, key, {
value: propertyTarget.value,
configurable: true,
enumerable: true,
Expand Down
4 changes: 0 additions & 4 deletions tests/deepmerge-into.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,6 @@ describe("deepmergeInto", () => {
const target = {};
deepmergeInto(target, a, b);
expect(target).toStrictEqual(expected);

expect(() => {
deepmergeInto(a, b);
}).toThrowError();
});

it("prototype pollution", () => {
Expand Down

0 comments on commit 6b04863

Please sign in to comment.