MCPcopy Index your code
hub / github.com/Effect-TS/effect / parseQuotedIndex

Function parseQuotedIndex

packages/effect/src/internal/configProvider.ts:642–654  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

640const QUOTED_INDEX_REGEX = /^(\[(\d+)\])$/
641
642const parseQuotedIndex = (str: string): Option.Option<number> => {
643 const match = str.match(QUOTED_INDEX_REGEX)
644 if (match !== null) {
645 const matchedIndex = match[2]
646 return pipe(
647 matchedIndex !== undefined && matchedIndex.length > 0 ?
648 Option.some(matchedIndex) :
649 Option.none(),
650 Option.flatMap(parseInteger)
651 )
652 }
653 return Option.none()
654}
655
656const splitIndexInKeys = (
657 map: Map<string, string>,

Callers

nothing calls this directly

Calls 1

pipeFunction · 0.70

Tested by

no test coverage detected