Merge pull request #1603 from fxOne/master

fixing `findOne` result type
This commit is contained in:
Anton Lavrenov
2023-07-12 16:16:00 -05:00
committed by GitHub

View File

@@ -220,7 +220,7 @@ export abstract class Container<
* return node.getType() === 'Shape'
* })
*/
findOne<ChildNode extends Node = Node>(selector: string | Function) {
findOne<ChildNode extends Node = Node>(selector: string | Function): ChildNode | undefined {
var result = this._generalFind<ChildNode>(selector, true);
return result.length > 0 ? result[0] : undefined;
}