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

View File

@@ -220,7 +220,7 @@ export abstract class Container<
* return node.getType() === 'Shape' * 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); var result = this._generalFind<ChildNode>(selector, true);
return result.length > 0 ? result[0] : undefined; return result.length > 0 ? result[0] : undefined;
} }