Skip to content

Commit

Permalink
Version 1.7.5 with fixed extend() bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
igoramadas committed Nov 3, 2021
1 parent 6641c7d commit 3506bb3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
4 changes: 4 additions & 0 deletions History.md
@@ -1,5 +1,9 @@
# Changelog for SetMeUp

1.7.5
=====
* Fixed regression bug with the utils.extend().

1.7.4
=====
* Updated dependencies.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "setmeup",
"version": "1.7.4",
"version": "1.7.5",
"description": "SetMeUp, your single and only settings manager.",
"keywords": [
"setmeup",
Expand Down
13 changes: 3 additions & 10 deletions src/utils.ts
Expand Up @@ -194,10 +194,7 @@ export function loadJson(filename: string, cryptoOptions?: CryptoOptions | boole
* @param overwrite If false it won't set properties that are already defined, default is true.
* @protected
*/
export function extend(source: any, target: any, overwrite: boolean): any[] {
const result = []

// Overwrite defaults to true.
export function extend(source: any, target: any, overwrite: boolean): void {
if (overwrite == null || typeof overwrite == "undefined") {
overwrite = true
}
Expand All @@ -209,15 +206,11 @@ export function extend(source: any, target: any, overwrite: boolean): any[] {
if (target[prop] == null) {
target[prop] = {}
}
result.push(this.extend(source[prop], target[prop], overwrite))
extend(source[prop], target[prop], overwrite)
} else if (overwrite || target[prop] == null) {
result.push((target[prop] = source[prop]))
} else {
result.push(undefined)
target[prop] = source[prop]
}
}

return result
}

/**
Expand Down

0 comments on commit 3506bb3

Please sign in to comment.