HEX
Server: Apache
System: Linux srv4.garantili.com.tr 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: ekspardev (1006)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/ekspardev/tubisad-backend/node_modules/@babel/node/lib/_babel-node.js.map
{"version":3,"names":["program","commander","Command","collect","value","previousValue","values","split","push","option","version","usage","parse","process","argv","babelOptions","caller","name","extensions","ignore","only","plugins","presets","configFile","envName","rootMode","babelrc","undefined","key","Object","keys","register","replPlugin","types","t","visitor","VariableDeclaration","path","node","kind","buildCodeFrameError","Program","hasExpressionStatement","bodyPath","get","isExpressionStatement","isExportDeclaration","isImportDeclaration","pushContainer","expressionStatement","identifier","_eval","code","filename","trim","babel","transformSync","concat","vm","runInThisContext","eval","print","global","__filename","__dirname","cwd","module","Module","paths","_nodeModulePaths","exports","require","bind","result","output","inspect","stdout","write","args","length","slice","i","ignoreNext","some","arg","i2","parsedOption","options","find","long","short","optionName","attributeName","parsedArg","requireArgs","isAbsolute","join","execArgv","runMain","replStart","replEval","context","callback","err","e","replServer","repl","start","prompt","input","stdin","useGlobal","preview","NODE_REPL_HISTORY","env","setupHistory"],"sources":["../src/_babel-node.ts"],"sourcesContent":["import commander from \"commander\";\nimport Module from \"module\";\nimport { inspect } from \"util\";\nimport path from \"path\";\nimport repl from \"repl\";\nimport * as babel from \"@babel/core\";\nimport vm from \"vm\";\nimport \"core-js/stable/index\";\nimport \"regenerator-runtime/runtime\";\n// @ts-expect-error @babel/register is a CommonJS module\nimport register from \"@babel/register\";\nimport { fileURLToPath } from \"url\";\nimport { createRequire } from \"module\";\n\nimport type { PluginAPI, PluginObject } from \"@babel/core\";\n\nconst require = createRequire(import.meta.url);\n\nconst program = new commander.Command(\"babel-node\");\n\nfunction collect(value: unknown, previousValue: string[]): Array<string> {\n  // If the user passed the option with no value, like \"babel-node file.js --presets\", do nothing.\n  if (typeof value !== \"string\") return previousValue;\n\n  const values = value.split(\",\");\n\n  if (previousValue) {\n    previousValue.push(...values);\n    return previousValue;\n  }\n  return values;\n}\n\nprogram.option(\"-e, --eval [script]\", \"Evaluate script\");\nprogram.option(\n  \"--no-babelrc\",\n  \"Specify whether or not to use .babelrc and .babelignore files\",\n);\nprogram.option(\"-r, --require [module]\", \"Require module\");\nprogram.option(\"-p, --print [code]\", \"Evaluate script and print result\");\nprogram.option(\n  \"-o, --only [globs]\",\n  \"A comma-separated list of glob patterns to compile\",\n  collect,\n);\nprogram.option(\n  \"-i, --ignore [globs]\",\n  \"A comma-separated list of glob patterns to skip compiling\",\n  collect,\n);\nprogram.option(\n  \"-x, --extensions [extensions]\",\n  \"List of extensions to hook into [.es6,.js,.es,.jsx,.mjs]\",\n  collect,\n);\nprogram.option(\n  \"--config-file [path]\",\n  \"Path to the babel config file to use. Defaults to working directory babel.config.js\",\n);\nprogram.option(\n  \"--env-name [name]\",\n  \"The name of the 'env' to use when loading configs and plugins. \" +\n    \"Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'.\",\n);\nprogram.option(\n  \"--root-mode [mode]\",\n  \"The project-root resolution mode. \" +\n    \"One of 'root' (the default), 'upward', or 'upward-optional'.\",\n);\nprogram.option(\"-w, --plugins [string]\", \"\", collect);\nprogram.option(\"-b, --presets [string]\", \"\", collect);\n\ndeclare const PACKAGE_JSON: { name: string; version: string };\nprogram.version(PACKAGE_JSON.version);\nprogram.usage(\"[options] [ -e script | script.js ] [arguments]\");\nprogram.parse(process.argv);\n\nconst babelOptions = {\n  caller: {\n    name: \"@babel/node\",\n  },\n  extensions: program.extensions,\n  ignore: program.ignore,\n  only: program.only,\n  plugins: program.plugins,\n  presets: program.presets,\n  configFile: program.configFile,\n  envName: program.envName,\n  rootMode: program.rootMode,\n\n  // Commander will default the \"--no-\" arguments to true, but we want to\n  // leave them undefined so that @babel/core can handle the\n  // default-assignment logic on its own.\n  babelrc: program.babelrc === true ? undefined : program.babelrc,\n};\n\nfor (const key of Object.keys(babelOptions) as Array<\n  keyof typeof babelOptions\n>) {\n  if (babelOptions[key] === undefined) {\n    delete babelOptions[key];\n  }\n}\n\nregister(babelOptions);\n\nconst replPlugin = ({ types: t }: PluginAPI): PluginObject => ({\n  visitor: {\n    VariableDeclaration(path) {\n      if (path.node.kind !== \"var\") {\n        throw path.buildCodeFrameError(\n          \"Only `var` variables are supported in the REPL\",\n        );\n      }\n    },\n\n    Program(path) {\n      let hasExpressionStatement: boolean;\n      for (const bodyPath of path.get(\"body\")) {\n        if (bodyPath.isExpressionStatement()) {\n          hasExpressionStatement = true;\n        } else if (\n          bodyPath.isExportDeclaration() ||\n          bodyPath.isImportDeclaration()\n        ) {\n          throw bodyPath.buildCodeFrameError(\n            \"Modules aren't supported in the REPL\",\n          );\n        }\n      }\n      if (hasExpressionStatement) return;\n\n      // If the executed code doesn't evaluate to a value,\n      // prevent implicit strict mode from printing 'use strict'.\n      path.pushContainer(\n        \"body\",\n        t.expressionStatement(t.identifier(\"undefined\")),\n      );\n    },\n  },\n});\n\nconst _eval = function (code: string, filename: string) {\n  code = code.trim();\n  if (!code) return undefined;\n\n  code = babel.transformSync(code, {\n    filename: filename,\n    presets: program.presets,\n    plugins: (program.plugins || []).concat([replPlugin]),\n  }).code;\n\n  return vm.runInThisContext(code, {\n    filename: filename,\n  });\n};\n\nif (program.eval || program.print) {\n  let code = program.eval;\n  if (!code || code === true) code = program.print;\n\n  global.__filename = \"[eval]\";\n  global.__dirname = process.cwd();\n\n  const module = new Module(global.__filename);\n  module.filename = global.__filename;\n  // @ts-expect-error todo(flow->ts)\n  module.paths = Module._nodeModulePaths(global.__dirname);\n\n  global.exports = module.exports;\n  global.module = module;\n  global.require = module.require.bind(module);\n\n  const result = _eval(code, global.__filename);\n  if (program.print) {\n    const output = typeof result === \"string\" ? result : inspect(result);\n    process.stdout.write(output + \"\\n\");\n  }\n} else {\n  if (program.args.length) {\n    // slice all arguments up to the first filename since they're babel args that we handle\n    let args = process.argv.slice(2);\n\n    let i = 0;\n    let ignoreNext = false;\n    args.some(function (arg, i2) {\n      if (ignoreNext) {\n        ignoreNext = false;\n        return;\n      }\n\n      if (arg[0] === \"-\") {\n        const parsedOption = program.options.find((option: any) => {\n          return option.long === arg || option.short === arg;\n        });\n        if (parsedOption === undefined) {\n          return;\n        }\n        const optionName = parsedOption.attributeName();\n        const parsedArg = program[optionName];\n        if (optionName === \"require\" || (parsedArg && parsedArg !== true)) {\n          ignoreNext = true;\n        }\n      } else {\n        i = i2;\n        return true;\n      }\n    });\n    args = args.slice(i);\n\n    requireArgs();\n\n    // make the filename absolute\n    const filename = args[0];\n    if (!path.isAbsolute(filename)) {\n      args[0] = path.join(process.cwd(), filename);\n    }\n\n    // add back on node and concat the sliced args\n    process.argv = [\"node\", ...args];\n    process.execArgv.push(fileURLToPath(import.meta.url));\n\n    Module.runMain();\n  } else {\n    requireArgs();\n    replStart();\n  }\n}\n\n// We have to handle require ourselves, as we want to require it in the context of babel-register\nfunction requireArgs() {\n  if (program.require) {\n    require(require.resolve(program.require, {\n      paths: [process.cwd()],\n    }));\n  }\n}\nfunction replEval(\n  this: repl.REPLServer,\n  code: string,\n  context: vm.Context,\n  filename: string,\n  callback: (err: Error | null, result: any) => void,\n) {\n  let err;\n  let result;\n\n  try {\n    if (code[0] === \"(\" && code[code.length - 1] === \")\") {\n      code = code.slice(1, -1); // remove \"(\" and \")\"\n    }\n\n    result = _eval(code, filename);\n  } catch (e) {\n    err = e;\n  }\n\n  callback(err, result);\n}\n\nfunction replStart() {\n  const replServer = repl.start({\n    prompt: \"babel > \",\n    input: process.stdin,\n    output: process.stdout,\n    eval: replEval,\n    useGlobal: true,\n    preview: true,\n  });\n  const NODE_REPL_HISTORY = process.env.NODE_REPL_HISTORY;\n  if (process.env.BABEL_8_BREAKING) {\n    replServer.setupHistory(NODE_REPL_HISTORY, () => {});\n  } else {\n    replServer.setupHistory?.(NODE_REPL_HISTORY, () => {});\n  }\n}\n"],"mappings":";;AAAA;AACA;AACA;AAC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