forked from ember-bootstrap/ember-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove useDefaultValueIfUndefined optional feature, amke it default b…
…ehavior As discussed in ember-bootstrap#1282 (comment), we remove the optional feature introduced in ember-bootstrap#1248 again, and make its behavior the default one.
- Loading branch information
1 parent
f808161
commit d3d4708
Showing
8 changed files
with
71 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
import { macroCondition, getOwnConfig } from '@embroider/macros'; | ||
|
||
export default function arg(target, key, descriptor) { | ||
let defaultValue = descriptor.initializer ? descriptor.initializer() : undefined; | ||
|
||
return { | ||
get() { | ||
if (macroCondition(getOwnConfig().useDefaultValueIfUndefined)) { | ||
const argValue = this.args[key]; | ||
return argValue !== undefined ? argValue : defaultValue; | ||
} else { | ||
return Object.keys(this.args).includes(key) ? this.args[key] : defaultValue; | ||
} | ||
const argValue = this.args[key]; | ||
return argValue !== undefined ? argValue : defaultValue; | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters