Skip to content

Commit

Permalink
fix: deny modifying the object prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
WikiRik authored Oct 25, 2023
1 parent 837a3cc commit ff1d9d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function deepAssign<T, S>(target: T, source: S): T & S;
export function deepAssign<S>(target: {}, source: S): S;
export function deepAssign(target: any, ...sources: any[]): any {
sources.forEach((source) => {
Object.getOwnPropertyNames(source).forEach((key) => assign(key, target, source));
Object.getOwnPropertyNames(source).forEach((key) => !["__proto__", "constructor", "prototype"].includes(key) && assign(key, target, source));

Check failure on line 17 in src/shared/object.ts

View workflow job for this annotation

GitHub Actions / build (12.x)

Replace `(key)·=>·!["__proto__",·"constructor",·"prototype"].includes(key)·&&·assign(key,·target,·source)` with `⏎······(key)·=>⏎········!['__proto__',·'constructor',·'prototype'].includes(key)·&&·assign(key,·target,·source)⏎····`

Check failure on line 17 in src/shared/object.ts

View workflow job for this annotation

GitHub Actions / build (14.x)

Replace `(key)·=>·!["__proto__",·"constructor",·"prototype"].includes(key)·&&·assign(key,·target,·source)` with `⏎······(key)·=>⏎········!['__proto__',·'constructor',·'prototype'].includes(key)·&&·assign(key,·target,·source)⏎····`

Check failure on line 17 in src/shared/object.ts

View workflow job for this annotation

GitHub Actions / build (16.x)

Replace `(key)·=>·!["__proto__",·"constructor",·"prototype"].includes(key)·&&·assign(key,·target,·source)` with `⏎······(key)·=>⏎········!['__proto__',·'constructor',·'prototype'].includes(key)·&&·assign(key,·target,·source)⏎····`
/* istanbul ignore next */
if (Object.getOwnPropertySymbols) {
Object.getOwnPropertySymbols(source).forEach((key) => assign(key, target, source));
Expand Down

0 comments on commit ff1d9d8

Please sign in to comment.