* Refactor condition in printStatementSequence, add new helper function. * Add new test cases. * Move logic in SwitchCase case. * Revert unrelated changes, remove unecessary variables. * Use util.getLast helper function. * Move variables out of the loop. * Simplify code. * Fix mapping with mutated path.
20 lines
254 B
JavaScript
20 lines
254 B
JavaScript
switch (node && node.type) {
|
|
case "Property":
|
|
case "MethodDefinition":
|
|
prop = node.key;
|
|
break;
|
|
|
|
case "MemberExpression":
|
|
prop = node.property;
|
|
break;
|
|
|
|
// no default
|
|
}
|
|
|
|
switch (foo) {
|
|
case "bar":
|
|
doThing()
|
|
|
|
// no default
|
|
}
|