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)) {
fork icon220
star icon0
watch icon26

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, {
fork icon220
star icon0
watch icon0

+ 3 other calls in file

Other functions in @babel/types

Sorted by popularity

function icon

@babel/types.identifier is the most popular function in @babel/types (20936 examples)