MCPcopy
hub / github.com/autoNumeric/autoNumeric / isPristine

Method isPristine

src/AutoNumeric.js:2643–2652  ·  view source on GitHub ↗

* Return `true` if the current value is the same as when the element got initialized. * Note: By default, this returns `true` if the raw unformatted value is still the same even if the formatted one has changed (due to a configuration update for instance). * In order to test if the formatt

(checkOnlyRawValue = true)

Source from the content-addressed store, hash-verified

2641 * @returns {boolean}
2642 */
2643 isPristine(checkOnlyRawValue = true) {
2644 let result;
2645 if (checkOnlyRawValue) {
2646 result = this.initialValue === this.getNumericString();
2647 } else {
2648 result = this.initialValueHtmlAttribute === this.getFormatted();
2649 }
2650
2651 return result;
2652 }
2653
2654 /**
2655 * Select the formatted element content, based on the `selectNumberOnly` option

Callers 5

_setRawValueMethod · 0.95
_setElementValueMethod · 0.95
_onKeyupMethod · 0.95
constructorMethod · 0.80

Calls 2

getNumericStringMethod · 0.95
getFormattedMethod · 0.95

Tested by

no test coverage detected