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
commit 6abd79c861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}