MCPcopy Create free account
hub / github.com/Marus/cortex-debug / handleObject

Function handleObject

src/docgen.ts:3–14  ·  view source on GitHub ↗
(obj: any, prop: string, appliesTo, stream: fs.WriteStream)

Source from the content-addressed store, hash-verified

1import * as fs from 'fs';
2
3function handleObject(obj: any, prop: string, appliesTo, stream: fs.WriteStream) {
4 const keys = Object.keys(obj).sort();
5 for (const key of keys) {
6 const child = obj[key];
7 const chProp = prop + '<br>.' + key;
8 const chType = getType(child);
9 stream.write(`| ${chProp} | ${chType} | ${appliesTo} | ${child.description} |\n`);
10 if (child.properties) {
11 handleObject(child.properties, chProp, appliesTo, stream);
12 }
13 }
14}
15
16function getType(obj: any) {
17 const pipe = ' &#124; ';

Callers 1

packageJSONtoMdFunction · 0.85

Calls 2

getTypeFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected