Skip to content

Commit c6c96f6

Browse files
authored
Merge pull request #7824 from IIITM-Jay/fes_bug/optional_param
Prevent FES from checking nested properties
2 parents a46490d + ae70e65 commit c6c96f6

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

docs/parameterData.json

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,6 @@
19911991
"String",
19921992
"String?",
19931993
"Object?",
1994-
"String|String[]?",
19951994
"Function?",
19961995
"Function?"
19971996
],
@@ -2734,13 +2733,7 @@
27342733
],
27352734
[
27362735
"String|Request",
2737-
"Object?",
2738-
"String?",
2739-
"function(p5.Geometry)?",
2740-
"function(Event)?",
2741-
"Boolean?",
2742-
"Boolean?",
2743-
"Boolean?"
2736+
"Object?"
27442737
]
27452738
]
27462739
},
@@ -2769,12 +2762,7 @@
27692762
[
27702763
"String",
27712764
"String?",
2772-
"Object?",
2773-
"function(p5.Geometry)?",
2774-
"function(Event)?",
2775-
"boolean?",
2776-
"boolean?",
2777-
"boolean?"
2765+
"Object?"
27782766
]
27792767
]
27802768
},
@@ -4474,9 +4462,7 @@
44744462
"Number",
44754463
"Number",
44764464
"Number",
4477-
"Object?",
4478-
"Number?",
4479-
"Number?"
4465+
"Object?"
44804466
]
44814467
]
44824468
}

utils/convert.mjs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,23 +231,22 @@ function getParams(entry) {
231231
// instead convert it to a string. We want a slightly different conversion to
232232
// string, so we match these params to the Documentation.js-provided `params`
233233
// array and grab the description from those.
234-
return (entry.tags || []).filter(t => t.title === 'param').map(node => {
235-
const param = entry.params.find(param => param.name === node.name);
236-
if (param) {
234+
return (entry.tags || [])
235+
236+
// Filter out the nested parameters (eg. options.extrude),
237+
// to be treated as part of parent parameters (eg. options)
238+
// and not separate entries
239+
.filter(t => t.title === 'param' && !t.name.includes('.'))
240+
.map(node => {
241+
const param = (entry.params || []).find(param => param.name === node.name);
237242
return {
238243
...node,
239-
description: param.description
240-
};
241-
} else {
242-
return {
243-
...node,
244-
description: {
244+
description: param?.description || {
245245
type: 'html',
246246
value: node.description
247247
}
248248
};
249-
}
250-
});
249+
});
251250
}
252251

253252
// ============================================================================

0 commit comments

Comments
 (0)