* Sets or removes brackets on negative values, depending on the focus state, which is passed as `isFocused`. * The focus state is 'stored' in that object property. * * @param {string} value * @param {object} settings * @param {boolean} isFocused * @returns {*}
(value, settings, isFocused)
| 5038 | * @returns {*} |
| 5039 | */ |
| 5040 | static _toggleNegativeBracket(value, settings, isFocused) { |
| 5041 | //XXX Note; this function is static since we need to pass a `settings` object when calling the static `AutoNumeric.format()` method |
| 5042 | let result; |
| 5043 | if (isFocused) { |
| 5044 | result = this._removeBrackets(value, settings); |
| 5045 | } else { |
| 5046 | result = this._addBrackets(value, settings); |
| 5047 | } |
| 5048 | |
| 5049 | return result; |
| 5050 | } |
| 5051 | |
| 5052 | /** |
| 5053 | * Add the bracket types specified in the `settings` object, to the given string `value`. |
no test coverage detected