MCPcopy Create free account
hub / github.com/documentationjs/documentation / paramList

Function paramList

src/output/markdown_ast.js:72–106  ·  view source on GitHub ↗
(params)

Source from the content-addressed store, hash-verified

70 }
71
72 function paramList(params) {
73 if (params.length === 0) return [];
74 return u(
75 'list',
76 { ordered: false, spread: false },
77 params.map(param =>
78 u(
79 'listItem',
80 [
81 u(
82 'paragraph',
83 [
84 u('inlineCode', param.name),
85 u('text', ' '),
86 !!param.type && u('strong', formatType(param.type)),
87 u('text', ' ')
88 ]
89 .concat(param.description ? param.description.children : [])
90 .concat([
91 !!param.default &&
92 u('paragraph', [
93 u('text', ' (optional, default '),
94 u('inlineCode', param.default),
95 u('text', ')')
96 ])
97 ])
98 .filter(Boolean)
99 )
100 ]
101 .concat(param.properties && paramList(param.properties))
102 .filter(Boolean)
103 )
104 )
105 );
106 }
107
108 function paramSection(comment) {
109 return (

Callers 1

paramSectionFunction · 0.85

Calls 1

formatTypeFunction · 0.85

Tested by

no test coverage detected