MCPcopy
hub / github.com/GoogleChromeLabs/squoosh / inputFieldValueAsNumber

Function inputFieldValueAsNumber

src/lib/util.ts:233–236  ·  view source on GitHub ↗
(field: any, defaultVal: number = 0)

Source from the content-addressed store, hash-verified

231 * @param defaultVal Value to return if 'field' doesn't exist.
232 */
233export function inputFieldValueAsNumber(field: any, defaultVal: number = 0): number {
234 if (!field) return defaultVal;
235 return Number(inputFieldValue(field));
236}
237
238/**
239 * @param field An HTMLInputElement, but the casting is done here to tidy up onChange.

Callers 7

reportOptionsMethod · 0.90
onWidthInputMethod · 0.90
onHeightInputMethod · 0.90
onChangeMethod · 0.90
onChangeMethod · 0.90
onChangeMethod · 0.90
onChangeMethod · 0.90

Calls 1

inputFieldValueFunction · 0.85

Tested by

no test coverage detected