MCPcopy Create free account
hub / github.com/Effect-TS/effect / run

Function run

packages/effect/src/internal/jsonParser.ts:77–82  ·  view source on GitHub ↗
(pattern: RegExp)

Source from the content-addressed store, hash-verified

75
76 /** Advances past a sticky pattern at `i`, returning the matched length. */
77 const run = (pattern: RegExp) => {
78 pattern.lastIndex = i
79 const length = pattern.test(text) ? pattern.lastIndex - i : 0
80 i += length
81 return length
82 }
83
84 const word = <A>(literal: string, result: A): A => {
85 if (!text.startsWith(literal, i)) {

Callers 3

numberFunction · 0.70
stringFunction · 0.70
identifierFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected