@stemy/backend 4.0.3 → 4.0.5
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.
|
@@ -622,10 +622,12 @@ function copyRecursive(target, source, predicate) {
|
|
|
622
622
|
}
|
|
623
623
|
if (isBuffer(source))
|
|
624
624
|
return Buffer.from(source);
|
|
625
|
+
// If object defines __shouldCopy as false, then don't copy it
|
|
626
|
+
if (source.__shouldCopy === false)
|
|
627
|
+
return source;
|
|
628
|
+
// Copy object
|
|
625
629
|
const shouldCopy = isFunction(source.__shouldCopy) ? source.__shouldCopy : () => true;
|
|
626
630
|
if (isConstructor(source.constructor)) {
|
|
627
|
-
if (source.__shouldCopy === false)
|
|
628
|
-
return source;
|
|
629
631
|
if (!target) {
|
|
630
632
|
try {
|
|
631
633
|
target = new source.constructor();
|