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

Method finishIndex

packages/effect/src/SchemaAST.ts:2147–2165  ·  view source on GitHub ↗
(
      s: ObjectParserState,
      key: PropertyKey,
      k2: PropertyKey | typeof InternalParser.missing,
      inputValue: unknown,
      exitValue: Exit.Exit<unknown, SchemaIssue.Issue>
    )

Source from the content-addressed store, hash-verified

2145 | undefined
2146 type Index = NonNullable<typeof indexes>[number]
2147 const finishIndex = (
2148 s: ObjectParserState,
2149 key: PropertyKey,
2150 k2: PropertyKey | typeof InternalParser.missing,
2151 inputValue: unknown,
2152 exitValue: Exit.Exit<unknown, SchemaIssue.Issue>
2153 ): Effect.Effect<void, SchemaIssue.Issue, any> => {
2154 if (exitValue._tag === "Failure") {
2155 return wrapPropertyKeyIssue(s, ast, key, exitValue) ?? Exit.void
2156 }
2157 const value = exitValue === InternalParser.sameExit
2158 ? inputValue
2159 : (exitValue as InternalParser.Success<unknown, SchemaIssue.Issue>)[InternalParser.args]
2160 if (k2 !== InternalParser.missing && value !== InternalParser.missing) {
2161 if (hasProperties && (expectedKeysSet!.has(key) || expectedKeysSet!.has(k2))) return Exit.void
2162 InternalRecord.assignProperty(s.out, k2, value)
2163 }
2164 return Exit.void
2165 }
2166 const parseIndex = (
2167 s: ObjectParserState,
2168 key: PropertyKey,

Callers

nothing calls this directly

Calls 2

wrapPropertyKeyIssueFunction · 0.85
hasMethod · 0.45

Tested by

no test coverage detected