{"size": 7838, "ext": "js", "max_stars_repo_path": "example/0_Basic_usage_of_the_library/javascript_babel/simple_example/8_自调用函数参数简化.js", "max_stars_repo_name": "RecluseXU/learning_spider", "max_stars_repo_stars_event_min_datetime": "2020-08-30T11:41:53.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-23T04:30:26.000Z", "max_issues_repo_path": "example/0_Basic_usage_of_the_library/javascript_babel/simple_example/8_自调用函数参数简化.js", "max_issues_repo_name": "RecluseXU/learning_spider", "max_issues_repo_issues_event_min_datetime": "2021-08-20T16:34:12.000Z", "max_issues_repo_issues_event_max_datetime": "2021-10-08T11:06:41.000Z", "max_forks_repo_path": "example/0_Basic_usage_of_the_library/javascript_babel/simple_example/8_自调用函数参数简化.js", "max_forks_repo_name": "RecluseXU/learning_spider", "max_forks_repo_forks_event_min_datetime": "2020-11-24T09:15:42.000Z", "max_forks_repo_forks_event_max_datetime": "2022-02-25T06:05:16.000Z"}
{"max_stars_count": 38, "max_issues_count": 2, "max_forks_count": 10, "avg_line_length": 147.8867924528, "max_line_length": 6269, "alphanum_fraction": 0.570170962}
// 将那些声明字面量参数 作为变量写入到函数体内，以压缩代码
// 形式:
//   (function(a){})('a')
//    变为
//   (function(){var a='a'})()

var js_env = "E:/Software/Programming/Environment/Nodejs/node_global/node_modules/";
const t = require(js_env + "@babel/types");
const parser = require(js_env + "@babel/parser");
const traverse = require(js_env + "@babel/traverse").default;
const generator = require(js_env + "@babel/generator").default;

const jscode = `
  var _0x5534 = ['UkRQY3Y=', 'c2NyaXA=', 'c2V0VGk=', 'bml1bQ==', 'RGF0YQ==', 'bmlyQno=', 'ZUV2ZW4=', 'ZWtkcmw=', 'ZENoaWw=', 'b3VNWEo=', 'aWdPUVY=', 'QmFIZWM=', 'aWNlY2E=', 'LmNvbQ==', 'ZjE3', 'ZjE1', 'UEpJT2Q=', 'bGVuZ3Q=', 'dGhlbl8=', 'c2VuZEQ=', 'cE54RHc=', 'R3hWbGk=', 'RXh6Tm8=', 'ZW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E=', 'bEFqdXE=', 'ZG9jZm4=', 'SlNCZWg=', 'Uml6cEE=', 'Y2lQRmM=', 'RXJ1T1g=', 'ci1yZW4=', 'ZW5jcnk=', 'aFJlc3U=', 'ZjMx', 'dG9HTVQ=', 'Y2FsbFA=', 'LmJhaWQ=', 'cGNTZWE=', 'dmUgY28=', 'SVRCa1c=', 'bnVtUGU=', 'UndQdFo=', 'Zk5JRmk=', 'RE1WR3o=', 'ZjI5', 'Q010Ync=', 'dWVsQng=', 'VGFyZ2U=', 'bEttV1U=', 'VHpQbVg=', 'b1NjSUs=', 'anNFcnI=', 'W25hdGk=', 'YmNw', 'MXw0', 'SWJObUs=', 'Y3JlYXQ=', 'IGFybXY=', 'Y29sbGU=', 'QnpoeEg=', 'eXhGRHg='];

  (function (_0x1d4248, _0x553400) {
    var _0x350641 = function (_0x4e0cde) {
      while (--_0x4e0cde) {
        _0x1d4248['push'](_0x1d4248['shift']());
      }
    };

    _0x350641(++_0x553400);
  })(_0x5534, 222);
`;
let ast = parser.parse(jscode);


const visitor = {
    "CallExpression"(path){
        let exp_node = path.node;
        if(!t.isFunctionExpression(exp_node.callee))return;
        for(arg_ind in exp_node.arguments){

            if(!t.isLiteral(exp_node.arguments[arg_ind]))continue;
            let {type, value} = exp_node.arguments.splice(arg_ind)[0];
            let neo_var_name = exp_node.callee.params.splice(arg_ind)[0].name;
            let neo_var_node = t.variableDeclaration(
                "var",
                [
                    t.VariableDeclarator(
                        t.Identifier(neo_var_name),
                        t[type](value),
                    )
                ]
            );
            path.get('callee.body.body.0').insertBefore(neo_var_node)
        }
    },
}
traverse(ast, visitor);
console.log('----------------------------');
console.log(generator(ast)['code']);