MCPcopy Create free account
hub / github.com/denoland/std / infinity

Function infinity

toml/_parser.ts:607–615  ·  view source on GitHub ↗
(scanner: Scanner)

Source from the content-addressed store, hash-verified

605]);
606const INFINITY_REGEXP = /[+-]?inf\b/y;
607export function infinity(scanner: Scanner): ParseResult<number> {
608 scanner.skipWhitespaces();
609 const match = scanner.match(INFINITY_REGEXP);
610 if (!match) return failure();
611 const string = match[0];
612 scanner.next(string.length);
613 const value = INFINITY_MAP.get(string)!;
614 return success(value);
615}
616
617const NAN_REGEXP = /[+-]?nan\b/y;
618export function nan(scanner: Scanner): ParseResult<number> {

Callers

nothing calls this directly

Calls 6

failureFunction · 0.85
successFunction · 0.85
matchMethod · 0.80
getMethod · 0.65
skipWhitespacesMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected