MCPcopy Index your code
hub / github.com/pmxt-dev/pmxt / collectSampleClassNames

Function collectSampleClassNames

core/test/unit/openapi-code-samples.test.js:26–38  ·  view source on GitHub ↗
(spec, language)

Source from the content-addressed store, hash-verified

24}
25
26function collectSampleClassNames(spec, language) {
27 return [
28 ...new Set(
29 Object.values(spec.paths || {})
30 .flatMap((pathItem) => Object.values(pathItem))
31 .filter((operation) => operation && typeof operation === 'object')
32 .flatMap((operation) => operation['x-codeSamples'] || [])
33 .filter((sample) => sample.lang === language)
34 .filter((sample) => !['Python', 'TypeScript'].includes(sample.label))
35 .map((sample) => sample.label),
36 ),
37 ].sort();
38}
39
40function collectTypescriptExports(source) {
41 return new Set(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected