* Merge the option objects found in the given array `optionsArray`. * If a `string` is found, then we try to get the related pre-defined option using that string as its name. * When merging the options, the latest option overwrite any previously set. This allows to fine tune a pre-defined
(optionsArray)
| 1115 | * @returns {{}} |
| 1116 | */ |
| 1117 | static mergeOptions(optionsArray) { |
| 1118 | // This allows the user to use multiple options (strings or objects) in an array, and overwrite the previous one with the next option element ; this is useful to tune the wanted format |
| 1119 | const mergedOptions = {}; |
| 1120 | optionsArray.forEach(optionObjectOrPredefinedOptionString => { |
| 1121 | Object.assign(mergedOptions, this._getOptionObject(optionObjectOrPredefinedOptionString)); |
| 1122 | }); |
| 1123 | |
| 1124 | return mergedOptions; |
| 1125 | } |
| 1126 | |
| 1127 | /** |
| 1128 | * Return `true` if the given pre-defined option name is an attribute of the `AutoNumeric.predefinedOptions` object |
no test coverage detected