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

Function visit

scripts/codegen/utils.ts:858–886  ·  view source on GitHub ↗
(node: unknown)

Source from the content-addressed store, hash-verified

856 };
857
858 const visit = (node: unknown): void => {
859 if (!node || typeof node !== "object") return;
860 if (Array.isArray(node)) {
861 for (const item of node) visit(item);
862 return;
863 }
864 const record = node as Record<string, unknown>;
865 const props = record.properties;
866 if (props && typeof props === "object" && !Array.isArray(props)) {
867 for (const propSchema of Object.values(props as Record<string, unknown>)) {
868 if (!propSchema || typeof propSchema !== "object") continue;
869 if (!isSchemaInternal(propSchema as JSONSchema7) && propertyReferencesInternal(propSchema as JSONSchema7)) {
870 (propSchema as Record<string, unknown>).visibility = "internal";
871 }
872 visit(propSchema);
873 }
874 }
875 for (const key of ["items", "additionalProperties", "anyOf", "allOf", "oneOf"]) {
876 if (record[key]) visit(record[key]);
877 }
878 for (const collectionKey of ["definitions", "$defs"]) {
879 const collection = record[collectionKey];
880 if (collection && typeof collection === "object" && !Array.isArray(collection)) {
881 for (const def of Object.values(collection as Record<string, unknown>)) {
882 if (def && typeof def === "object") visit(def);
883 }
884 }
885 }
886 };
887
888 visit(schema);
889 return schema;

Calls 10

isSchemaInternalFunction · 0.85
isSchemaExperimentalFunction · 0.85
parseExternalSchemaRefFunction · 0.85
parseLocalDefinitionRefFunction · 0.85
joinMethod · 0.80
addMethod · 0.45
pushMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…