docs: fix nested union handling (#5341)
This commit is contained in:
parent
983e04374a
commit
a1b3164864
|
|
@ -734,7 +734,7 @@ to pass. This method throws when the element is detached while waiting, unless w
|
||||||
If the element does not satisfy the condition for the [`option: timeout`] milliseconds, this method will throw.
|
If the element does not satisfy the condition for the [`option: timeout`] milliseconds, this method will throw.
|
||||||
|
|
||||||
### param: ElementHandle.waitForElementState.state
|
### param: ElementHandle.waitForElementState.state
|
||||||
- `state` <"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">
|
- `state` <[ElementStateEnum]<"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">>
|
||||||
|
|
||||||
A state to wait for, see below for more details.
|
A state to wait for, see below for more details.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -429,11 +429,14 @@ Documentation.Type = class {
|
||||||
*/
|
*/
|
||||||
static fromParsedType(parsedType, inUnion = false) {
|
static fromParsedType(parsedType, inUnion = false) {
|
||||||
if (!inUnion && parsedType.union) {
|
if (!inUnion && parsedType.union) {
|
||||||
const name = parsedType.unionName || '';
|
const type = new Documentation.Type(parsedType.unionName || '');
|
||||||
const type = new Documentation.Type(name);
|
|
||||||
type.union = [];
|
type.union = [];
|
||||||
for (let t = parsedType; t; t = t.union)
|
for (let t = parsedType; t; t = t.union) {
|
||||||
type.union.push(Documentation.Type.fromParsedType(t, true));
|
const nestedUnion = !!t.unionName && t !== parsedType;
|
||||||
|
type.union.push(Documentation.Type.fromParsedType(t, !nestedUnion));
|
||||||
|
if (nestedUnion)
|
||||||
|
break;
|
||||||
|
}
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue