Skip to content

Commit

Permalink
chore: remove specific overwriting
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Oct 8, 2024
1 parent caad500 commit 1f1d33c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ ReflectionObject.prototype.setParsedOption = function setParsedOption(name, valu
// If we found an existing option - just merge the property value
// (If it's a feature, will just write over)
var newValue = opt[name];
util.setProperty(newValue, propName, value, isFeature);
util.setProperty(newValue, propName, value);
} else {
// otherwise, create a new option, set its property and add it to the list
opt = {};
opt[name] = util.setProperty({}, propName, value, isFeature);
opt[name] = util.setProperty({}, propName, value);
parsedOptions.push(opt);
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ util.decorateEnum = function decorateEnum(object) {
* @param {boolean} overWrite whether or not to concatenate the values into an array or overwrite; defaults to false.
* @returns {Object.<string,*>} Destination object
*/
util.setProperty = function setProperty(dst, path, value, overWrite = false) {
util.setProperty = function setProperty(dst, path, value) {
function setProp(dst, path, value) {
var part = path.shift();
if (part === "__proto__" || part === "prototype") {
Expand All @@ -184,7 +184,7 @@ util.setProperty = function setProperty(dst, path, value, overWrite = false) {
dst[part] = setProp(dst[part] || {}, path, value);
} else {
var prevValue = dst[part];
if (prevValue && !overWrite)
if (prevValue)
value = [].concat(prevValue).concat(value);
dst[part] = value;
}
Expand Down

0 comments on commit 1f1d33c

Please sign in to comment.