Skip to content

Commit

Permalink
feat: transpile || to ?:
Browse files Browse the repository at this point in the history
  • Loading branch information
cxtom committed Apr 29, 2019
1 parent 015dcd3 commit ee8bb7d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,9 @@ export function emitFile(
) {
writePunctuation(".=");
}
else if (node.operatorToken.kind === ts.SyntaxKind.BarBarToken) {
writePunctuation("?:");
}
else {
writeTokenNode(node.operatorToken, writeOperator, node.left, node.right);
}
Expand Down
7 changes: 1 addition & 6 deletions src/features/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ import {
isCallExpression,
isBinaryExpression,
SyntaxKind,
isStringLiteral,
TypeFlags,
createCall,
createIdentifier
} from 'typescript';

import method from '../utilities/method';
import {
isClassLike,
isClassInstance
} from '../utilities/nodeTest';
import {isClassInstance} from '../utilities/nodeTest';

const staticMap = {
assign: method('array_merge', false),
Expand Down

0 comments on commit ee8bb7d

Please sign in to comment.