MCPcopy Index your code
hub / github.com/github/copilot-sdk / resolveSharedAnyOfVariant

Function resolveSharedAnyOfVariant

scripts/codegen/go.ts:3611–3625  ·  view source on GitHub ↗
(
    variant: JSONSchema7 | boolean,
    definitions: Record<string, unknown>
)

Source from the content-addressed store, hash-verified

3609}
3610
3611function resolveSharedAnyOfVariant(
3612 variant: JSONSchema7 | boolean,
3613 definitions: Record<string, unknown>
3614): JSONSchema7 | undefined {
3615 if (typeof variant !== "object" || variant === null) return undefined;
3616 if (typeof variant.$ref === "string") {
3617 // Local $ref like "#/$defs/AttachmentFile" or "#/definitions/AttachmentFile".
3618 const localMatch = /^#\/(?:\$defs|definitions)\/(.+)$/.exec(variant.$ref);
3619 if (!localMatch) return undefined;
3620 const target = definitions[decodeURIComponent(localMatch[1])];
3621 if (!target || typeof target !== "object" || Array.isArray(target)) return undefined;
3622 return target as JSONSchema7;
3623 }
3624 return variant;
3625}
3626
3627/**
3628 * Scan hand-written `.go` files under `go/` and return every top-level exported

Calls 1

execMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…