mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
Use find array helper (#18557)
* Use `find` array helper * Provide explicit type argument to `find`
This commit is contained in:
@@ -934,12 +934,8 @@ namespace ts.refactor.extractMethod {
|
||||
* Otherwise, return `undefined`.
|
||||
*/
|
||||
function getNodeToInsertBefore(minPos: number, scope: Scope): Node | undefined {
|
||||
const children = getStatementsOrClassElements(scope);
|
||||
for (const child of children) {
|
||||
if (child.pos >= minPos && isFunctionLike(child) && !isConstructorDeclaration(child)) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
return find<Statement | ClassElement>(getStatementsOrClassElements(scope), child =>
|
||||
child.pos >= minPos && isFunctionLike(child) && !isConstructorDeclaration(child));
|
||||
}
|
||||
|
||||
function getPropertyAssignmentsForWrites(writes: ReadonlyArray<UsageEntry>): ShorthandPropertyAssignment[] {
|
||||
|
||||
Reference in New Issue
Block a user