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

Function parseKeptPathItem

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

Source from the content-addressed store, hash-verified

746 * identically wherever a structure is walked more than once, so per-operation
747 * indexes stay aligned across passes. */
748const parseKeptPathItem = (
749 structure: SpecStructure,
750 range: ByteRange,
751 keepPathItem: KeepPathItem | undefined,
752): readonly [string, PathItemObject] | null => {
753 const entry = parseEntry(structure.text, range, 2);
754 if (!entry) return null;
755 const [path, rawValue] = entry;
756 if (!isPathItemValue(rawValue)) return null;
757 if (!keepPathItem) return [path, rawValue as PathItemObject];
758 const kept = keepPathItem(path, rawValue);
759 return kept ? [path, kept as PathItemObject] : null;
760};
761
762/**
763 * 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