How to use the data function from @babel/types
Find comprehensive JavaScript @babel/types.data code examples handpicked from public code repositorys.
625 626 627 628 629 630 631 632 633 634
*/ expandForStatement () { // global.log('展开for循环') return { ForStatement (path) { //for (var e = t.data.result.list, a = 0; a < e.length; a++) o.data.kino_list.push(e[a]); //转换为: //for (var e = t.data.result.list, a = 0; a < e.length; a++) { that.kino_list.push(e[a]); } const body = path.node.body if (!t.isBlockStatement(body)) {
220
0
26
198 199 200 201 202 203 204 205 206 207
/** * 一行代码转多行代码 (还原http://lisperator.net/uglifyjs/压缩代码) * 1.用逗号连起 来的:a = 5, this.fun1(), this.fun2(); * 2.使用&&进行判断:a && a = 5, b = 6; * 3.if (1 == a.is_open_sku) o=4; else o=5; 改成多行展示 * 4.for (var e = t.data.result.list, a = 0; a < e.length; a++) o.data.kino_list.push(e[a]); 改多行 * @param {*} ast */ function oneLineToMultiLine (ast) { traverse(ast, {
220
0
0
+ 3 other calls in file
@babel/types.identifier is the most popular function in @babel/types (20936 examples)