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

Function boolean

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

Source from the content-addressed store, hash-verified

589
590const BOOLEAN_REGEXP = /(?:true|false)\b/y;
591export function boolean(scanner: Scanner): ParseResult<boolean> {
592 scanner.skipWhitespaces();
593 const match = scanner.match(BOOLEAN_REGEXP);
594 if (!match) return failure();
595 const string = match[0];
596 scanner.next(string.length);
597 const value = string === "true";
598 return success(value);
599}
600
601const INFINITY_MAP = new Map<string, number>([
602 ["inf", Infinity],

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected