MCPcopy
hub / github.com/autoNumeric/autoNumeric / mergeOptions

Method mergeOptions

src/AutoNumeric.js:1117–1125  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 2

_setArgumentsValuesMethod · 0.95
AutoNumeric.jsFile · 0.80

Calls 1

_getOptionObjectMethod · 0.95

Tested by

no test coverage detected