Skip to content

Commit 099bbde

Browse files
committed
Yep, it works and it's cleaner
1 parent 79ced38 commit 099bbde

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

ember-qunit-codemod.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -224,14 +224,12 @@ function updateModuleForToNestedModule(j, root) {
224224

225225
function updateLookupCalls(j, root) {
226226
return root
227-
.find(j.MemberExpression)
228-
.filter(path => {
229-
return (
230-
path.value.property.name === 'lookup' &&
231-
j.MemberExpression.check(path.value.object) &&
232-
path.value.object.property.name === 'container' &&
233-
j.ThisExpression.check(path.value.object.object)
234-
);
227+
.find(j.MemberExpression, {
228+
object: {
229+
object: { type: 'ThisExpression' },
230+
property: { name: 'container' },
231+
},
232+
property: { name: 'lookup' },
235233
})
236234
.forEach(path => {
237235
let thisDotOwner = j.memberExpression(j.thisExpression(), j.identifier('owner'));

0 commit comments

Comments
 (0)