File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -934,12 +934,8 @@ namespace ts.refactor.extractMethod {
934
934
* Otherwise, return `undefined`.
935
935
*/
936
936
function getNodeToInsertBefore ( minPos : number , scope : Scope ) : Node | undefined {
937
- const children = getStatementsOrClassElements ( scope ) ;
938
- for ( const child of children ) {
939
- if ( child . pos >= minPos && isFunctionLike ( child ) && ! isConstructorDeclaration ( child ) ) {
940
- return child ;
941
- }
942
- }
937
+ return find < Statement | ClassElement > ( getStatementsOrClassElements ( scope ) , child =>
938
+ child . pos >= minPos && isFunctionLike ( child ) && ! isConstructorDeclaration ( child ) ) ;
943
939
}
944
940
945
941
function getPropertyAssignmentsForWrites ( writes : ReadonlyArray < UsageEntry > ) : ShorthandPropertyAssignment [ ] {
You can’t perform that action at this time.
0 commit comments