string-mask
string-mask copied to clipboard
fix: Option usedefaults re-assign
var options = {
reverse: true,
usedefaults: false
}
var formatter = new StringMask('+00 (00) 0000-0000', options)
Old code;
usedefaults: this.options.usedefaults || this.options.reverse
OR operator (||) returns the condition on the right side but the expected one was to have returned the left side.
OR for defaults can be convenient because it is short and easy to write but to booleans parameters it was not good.