Patched prototype pollution
Some checks failed
Build / Tag Version (push) Has been cancelled
Build / Build NPM Project (push) Has been cancelled
Build / Publish Docs (push) Has been cancelled

This commit is contained in:
2026-08-17 14:56:18 -04:00
parent 4dfd70f6a7
commit 721fe2dcf8

View File

@@ -97,8 +97,10 @@ export function deepCopy<T>(value: T): T {
* @return {any} The des
*/
export function deepMerge<T>(target: any, ...sources: any[]): T {
const BLOCKED = new Set(['__proto__', 'constructor', 'prototype']);
sources.forEach(s => {
for(const key in s) {
if(BLOCKED.has(key) || !Object.prototype.hasOwnProperty.call(s, key)) continue;
if(s[key] && typeof s[key] == 'object' && !Array.isArray(s[key])) {
if(!target[key]) target[key] = {};
deepMerge(target[key], s[key]);