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

Function isSection

ini/parse.ts:24–34  ·  view source on GitHub ↗

Detect a section start.

(input: string, lineNumber: number)

Source from the content-addressed store, hash-verified

22
23/** Detect a section start. */
24function isSection(input: string, lineNumber: number): boolean {
25 if (input.startsWith("[")) {
26 if (input.endsWith("]")) {
27 return true;
28 }
29 throw new SyntaxError(
30 `Unexpected end of INI section at line ${lineNumber}`,
31 );
32 }
33 return false;
34}
35
36function* readTextLines(text: string): Generator<string> {
37 let line = "";

Callers 1

parseFunction · 0.85

Calls 1

startsWithMethod · 0.80

Tested by

no test coverage detected