jedison 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/jedison.js
CHANGED
|
@@ -116,11 +116,13 @@ function getType(value) {
|
|
|
116
116
|
}
|
|
117
117
|
return type2;
|
|
118
118
|
}
|
|
119
|
+
const UNSAFE_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
119
120
|
function mergeDeep(target, ...sources) {
|
|
120
121
|
if (!sources.length) return target;
|
|
121
122
|
const source = sources.shift();
|
|
122
123
|
if (isObject(target) && isObject(source)) {
|
|
123
124
|
Object.keys(source).forEach((key) => {
|
|
125
|
+
if (UNSAFE_KEYS.has(key)) return;
|
|
124
126
|
if (isObject(source[key])) {
|
|
125
127
|
if (!target[key]) {
|
|
126
128
|
Object.assign(target, {
|
|
@@ -144,6 +146,7 @@ function combineDeep(target, ...sources) {
|
|
|
144
146
|
target.push(...source);
|
|
145
147
|
} else if (isObject(target) && isObject(source)) {
|
|
146
148
|
Object.keys(source).forEach((key) => {
|
|
149
|
+
if (UNSAFE_KEYS.has(key)) return;
|
|
147
150
|
if (isObject(source[key])) {
|
|
148
151
|
if (!target[key]) {
|
|
149
152
|
Object.assign(target, {
|