MCPcopy Create free account
hub / github.com/testing-library/user-event / isValidFloatingPointNumber

Function isValidFloatingPointNumber

src/document/interceptor.ts:143–145  ·  view source on GitHub ↗
(v: string)

Source from the content-addressed store, hash-verified

141
142// https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#valid-floating-point-number
143function isValidFloatingPointNumber(v: string) {
144 return /^-?(?:\d+|\d*\.\d+)(?:[eE][-+]?\d+)?$/.test(v)
145}
146
147export function prepareSelectionInterceptor(
148 element: HTMLInputElement | HTMLTextAreaElement,

Callers 1

sanitizeValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected