Security Update

[+] Protect Prototype
This commit is contained in:
B0zal 2023-08-25 18:48:38 +07:00
parent 5e23ad2db1
commit 22a6819f7b
No known key found for this signature in database
GPG Key ID: 2359195A49CAA696

View File

@ -1,9 +1,13 @@
export function merge(target: any, source: any) {
Object.keys(source).forEach(function (key) {
if (source[key] && typeof source[key] === "object") {
if (
source.hasOwnProperty(key) && // Check if the property is not inherited
source[key] &&
typeof source[key] === "object" || key === "__proto__" || key === "constructor"
) {
merge((target[key] = target[key] || {}), source[key]);
return;
}
target[key] = source[key];
});
}
}