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

Function entryIndex

packages/effect/src/graphql/GraphQLResolver.ts:763–771  ·  view source on GitHub ↗
(error: GraphQLError, path: ReadonlyArray<string>, length: number)

Source from the content-addressed store, hash-verified

761}
762
763const entryIndex = (error: GraphQLError, path: ReadonlyArray<string>, length: number): number | undefined => {
764 const errorPath = error.path
765 if (errorPath === undefined || errorPath.length <= path.length) return undefined
766 for (let i = 0; i < path.length; i++) {
767 if (errorPath[i] !== path[i]) return undefined
768 }
769 const index = errorPath[path.length]
770 return typeof index === "number" && Number.isInteger(index) && index >= 0 && index < length ? index : undefined
771}
772
773const findList = (
774 data: unknown,

Callers 1

orderedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected