File tree Expand file tree Collapse file tree 1 file changed +43
-3
lines changed
Expand file tree Collapse file tree 1 file changed +43
-3
lines changed Original file line number Diff line number Diff line change @@ -113,11 +113,51 @@ export const leftHandAssign = (target, source) =>
113113/**
114114 * Transforms an object to JSON output consistent with the JSON version.
115115 * @param {Object } section - The source object
116+ * @param section.api
117+ * @param section.type
118+ * @param section.source
119+ * @param section.introduced_in
120+ * @param section.meta
121+ * @param section.stability
122+ * @param section.stabilityText
123+ * @param section.classes
124+ * @param section.methods
125+ * @param section.properties
126+ * @param section.miscs
127+ * @param section.modules
128+ * @param section.globals
116129 * @returns {string } - The JSON output
117130 */
118- export const legacyToJSON = section =>
131+ export const legacyToJSON = ( {
132+ api,
133+ type,
134+ source,
135+ introduced_in,
136+ meta,
137+ stability,
138+ stabilityText,
139+ classes,
140+ methods,
141+ properties,
142+ miscs,
143+ modules,
144+ globals,
145+ } ) =>
119146 JSON . stringify (
120- section ,
147+ {
148+ type,
149+ source,
150+ introduced_in,
151+ meta,
152+ stability,
153+ stabilityText,
154+ classes,
155+ methods,
156+ properties,
157+ miscs,
158+ modules,
159+ globals,
160+ } ,
121161 [
122162 // TODO: remove this array once all the additional keys have been introduced downstream
123163 'added' ,
@@ -138,7 +178,7 @@ export const legacyToJSON = section =>
138178 'meta' ,
139179 'methods' ,
140180 'miscs' ,
141- ...( section . api === 'index' ? [ ] : [ 'modules' ] ) ,
181+ ...( api === 'index' ? [ ] : [ 'modules' ] ) ,
142182 'name' ,
143183 'napiVersion' ,
144184 'options' ,
You can’t perform that action at this time.
0 commit comments