MCPcopy
hub / github.com/autoNumeric/autoNumeric / _get

Method _get

src/AutoNumeric.js:4760–4768  ·  view source on GitHub ↗

* DRY the code between the static `get*` functions * * @param {HTMLElement|string} domElementOrSelector * @param {string} getFunction The name of the non-static `get*` function as a string * @param {function|null} callback * @returns {*} * @private

(domElementOrSelector, getFunction, callback = null)

Source from the content-addressed store, hash-verified

4758 * @private
4759 */
4760 static _get(domElementOrSelector, getFunction, callback = null) {
4761 const domElement = AutoNumericHelper.domElement(domElementOrSelector);
4762
4763 if (!this.isManagedByAutoNumeric(domElement)) {
4764 AutoNumericHelper.throwError(`Impossible to find an AutoNumeric object for the given DOM element or selector.`);
4765 }
4766
4767 return this.getAutoNumericElement(domElement)[getFunction](callback);
4768 }
4769
4770 /**
4771 * Returns the unformatted value following the `outputFormat` setting, from the given DOM element or query selector.

Callers 3

getNumericStringMethod · 0.95
getFormattedMethod · 0.95
getNumberMethod · 0.95

Calls 4

getAutoNumericElementMethod · 0.95
domElementMethod · 0.80
throwErrorMethod · 0.80

Tested by

no test coverage detected