string-mask icon indicating copy to clipboard operation
string-mask copied to clipboard

fix: Option usedefaults re-assign

Open olavocneto opened this issue 8 years ago • 1 comments

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.

olavocneto avatar Mar 04 '17 14:03 olavocneto

Coverage Status

Coverage remained the same at 100.0% when pulling 5cd69bb264f9de10ceab4e1dd5fe246e2a4aacb5 on financialsistemas:bug/options-default into 094cc3104040c61a78564c6c0e640408b3264bb0 on the-darc:master.

coveralls avatar Mar 04 '17 14:03 coveralls