How to use the unaryExpression function from babel-types
Find comprehensive JavaScript babel-types.unaryExpression code examples handpicked from public code repositorys.
187 188 189 190 191 192 193 194 195 196
[t.identifier('key')], t.blockStatement([ t.ifStatement( t.binaryExpression( '!=', t.unaryExpression( 'typeof', t.memberExpression( t.identifier('snapshot'), t.memberExpression(
+ 9 other calls in file
GitHub: sbekrin/cljs-babel
![sbekrin profile picture](/sbekrin.png?size=40)
119 120 121 122 123 124 125 126 127 128
return t.identifier('NaN'); // Infinity -> Infinity // -Infinity -> -Infinity case l.InfinityNode: return node.negative ? t.unaryExpression('-', t.identifier('Infinity')) : t.identifier('Infinity'); // nil -> null case l.NullNode: return t.nullLiteral();
+ 9 other calls in file
124 125 126 127 128 129 130 131 132 133
]); }, OpenIf(branch, nextBranch) { let test = transforms[branch.test.tokenType](branch.test); if (branch.not) { test = t.unaryExpression('!', test, true); } let alternate = t.stringLiteral(''); if (nextBranch && nextBranch.tokenType === 'Else') {
13 14 15 16 17 18 19 20 21 22
) { var snapshotCall = path.findParent((path) => path.isCallExpression()); snapshotCall.insertAfter( t.ifStatement( t.unaryExpression('!', t.identifier('fromTheFuture'), true), t.blockStatement( [ t.expressionStatement( t.callExpression(t.memberExpression(t.identifier('console'), t.identifier('log')), [
babel-types.identifier is the most popular function in babel-types (4076 examples)