@ts-common/property-set
Advanced tools
Comparing version 0.0.5 to 0.0.6
10
index.js
@@ -39,10 +39,16 @@ "use strict"; | ||
}); | ||
let changes = false; | ||
forEach(factory, (k, propertyFactory) => { | ||
// tslint:disable-next-line:strict-type-predicates | ||
if (propertyFactory !== undefined) { | ||
setProperty(result, k, propertyFactory(k, source[k])); | ||
const sourceK = source[k]; | ||
const newProperty = propertyFactory(k, sourceK); | ||
if (sourceK !== newProperty) { | ||
setProperty(result, k, newProperty); | ||
changes = true; | ||
} | ||
} | ||
}); | ||
return fromMutableOptional(result); | ||
return changes ? fromMutableOptional(result) : source; | ||
} | ||
exports.copyCreate = copyCreate; |
{ | ||
"name": "@ts-common/property-set", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "A set of properties", | ||
@@ -41,5 +41,5 @@ "main": "index.js", | ||
"tslint": "^5.11.0", | ||
"typescript": "^3.0.0-rc" | ||
"typescript": "^3.0.1" | ||
}, | ||
"dependencies": {} | ||
} |
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
14809
68