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

Function parseQuotedIndex

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

Source from the content-addressed store, hash-verified

661const QUOTED_INDEX_REGEX = /^(\[(\d+)\])$/
662
663const parseQuotedIndex = (str: string): Option.Option<number> => {
664 const match = str.match(QUOTED_INDEX_REGEX)
665 if (match !== null) {
666 const matchedIndex = match[2]
667 return pipe(
668 matchedIndex !== undefined && matchedIndex.length > 0 ?
669 Option.some(matchedIndex) :
670 Option.none(),
671 Option.flatMap(parseInteger)
672 )
673 }
674 return Option.none()
675}
676
677const splitIndexInKeys = (
678 map: Map<string, string>,

Callers

nothing calls this directly

Calls 1

pipeFunction · 0.70

Tested by

no test coverage detected