MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / parseKeptPathItem

Function parseKeptPathItem

packages/plugins/openapi/src/sdk/extract.ts:824–836  ·  view source on GitHub ↗
(
  structure: SpecStructure,
  range: ByteRange,
  keepPathItem: KeepPathItem | undefined,
)

Source from the content-addressed store, hash-verified

822 * identically wherever a structure is walked more than once, so per-operation
823 * indexes stay aligned across passes. */
824const parseKeptPathItem = (
825 structure: SpecStructure,
826 range: ByteRange,
827 keepPathItem: KeepPathItem | undefined,
828): readonly [string, PathItemObject] | null => {
829 const entry = parseEntry(structure.text, range, 2);
830 if (!entry) return null;
831 const [path, rawValue] = entry;
832 if (!isPathItemValue(rawValue)) return null;
833 if (!keepPathItem) return [path, rawValue as PathItemObject];
834 const kept = keepPathItem(path, rawValue);
835 return kept ? [path, kept as PathItemObject] : null;
836};
837
838/**
839 * Stream invocation bindings straight from a `SpecStructure` (the structural

Callers 3

keptPathItemFunction · 0.85
streamPreviewOperationsFunction · 0.85
streamOutputSchemasFunction · 0.85

Calls 2

parseEntryFunction · 0.90
isPathItemValueFunction · 0.85

Tested by

no test coverage detected