* Apply any implied option values, if option is undefined or default value. * * @private
()
| 2006 | * @private |
| 2007 | */ |
| 2008 | _parseOptionsImplied() { |
| 2009 | const dualHelper = new DualOptions(this.options); |
| 2010 | const hasCustomOptionValue = (optionKey) => { |
| 2011 | return ( |
| 2012 | this.getOptionValue(optionKey) !== undefined && |
| 2013 | !['default', 'implied'].includes(this.getOptionValueSource(optionKey)) |
| 2014 | ); |
| 2015 | }; |
| 2016 | this.options |
| 2017 | .filter( |
| 2018 | (option) => |
| 2019 | option.implied !== undefined && |
| 2020 | hasCustomOptionValue(option.attributeName()) && |
| 2021 | dualHelper.valueFromOption( |
| 2022 | this.getOptionValue(option.attributeName()), |
| 2023 | option, |
| 2024 | ), |
| 2025 | ) |
| 2026 | .forEach((option) => { |
| 2027 | Object.keys(option.implied) |
| 2028 | .filter((impliedKey) => !hasCustomOptionValue(impliedKey)) |
| 2029 | .forEach((impliedKey) => { |
| 2030 | this.setOptionValueWithSource( |
| 2031 | impliedKey, |
| 2032 | option.implied[impliedKey], |
| 2033 | 'implied', |
| 2034 | ); |
| 2035 | }); |
| 2036 | }); |
| 2037 | } |
| 2038 | |
| 2039 | /** |
| 2040 | * Argument `name` is missing. |
no test coverage detected