How to use the isForInStatement function from @babel/types
Find comprehensive JavaScript @babel/types.isForInStatement code examples handpicked from public code repositorys.
GitHub: omarjuice/algo-viz
163 164 165 166 167 168 169 170 171 172
} }, VariableDeclaration: { exit(path) { const declarations = [] const isFor = t.isForInStatement(path.parent) || t.isForOfStatement(path.parent) path.get("declarations").forEach(traverseDeclarations(path, isFor, declarations)) if (isFor) { const parent = path.findParent(parent => t.isFor(parent))
5
27
1
+ 21 other calls in file
359 360 361 362 363 364 365 366 367 368
// 如标识符被修改过,则不能进行删除动作。 if (!binding || binding.constantViolations.length > 0) { return; } if (types.isForOfStatement(path.parentPath.parentPath) || types.isForInStatement(path.parentPath.parentPath) || types.isForStatement(path.parentPath.parentPath)) { return; } // 未被引用
2
1
1
+ 82 other calls in file
263 264 265 266 267 268 269 270 271 272
declaration: node }) || arrowBody && t.isArrowFunctionExpression(parent, { body: node }) || forHead && t.isForStatement(parent, { init: node }) || forInHead && t.isForInStatement(parent, { left: node }) || forOfHead && t.isForOfStatement(parent, { left: node })) {
0
0
0
+ 2 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)