fixing findOne result type

This commit is contained in:
Dominic Buetow 2023-07-12 10:04:47 +02:00 committed by GitHub
parent c1ba9740b3
commit 7133abe9cd
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;
}