reactive-di
Advanced tools
Comparing version 2.4.1 to 2.4.2
@@ -26,3 +26,3 @@ 'use strict'; | ||
function cloneInstance(target, props) { | ||
return new target.constructor(_extends({}, target, props)); | ||
return props instanceof target.constructor ? props : new target.constructor(_extends({}, target, props)); | ||
} | ||
@@ -29,0 +29,0 @@ |
{ | ||
"name": "reactive-di", | ||
"version": "2.4.1", | ||
"version": "2.4.2", | ||
"description": "Reactive dependency injection", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -20,3 +20,5 @@ // @flow | ||
function cloneInstance<Instance: Object>(target: Instance, props: $Shape<Instance>): Instance { | ||
return new target.constructor({...target, ...props}) | ||
return props instanceof target.constructor | ||
? props | ||
: new target.constructor({...target, ...props}) | ||
} | ||
@@ -23,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
330081
5127