MCPcopy Index your code
hub / github.com/autoNumeric/autoNumeric / _toggleNegativeBracket

Method _toggleNegativeBracket

src/AutoNumeric.js:5040–5050  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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`.

Callers 1

_addGroupSeparatorsMethod · 0.95

Calls 2

_removeBracketsMethod · 0.95
_addBracketsMethod · 0.95

Tested by

no test coverage detected