Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/es6-templates/lib/ drwxr-xr-x | |
| Viewing file: Select action/file-type: var through = require('through');
var Visitor = require('./visitor');
var recast = require('recast');
var types = recast.types;
/**
* Transform an Esprima AST generated from ES6 by replacing all template string
* nodes with the equivalent ES5.
*
* NOTE: The argument may be modified by this function. To prevent modification
* of your AST, pass a copy instead of a direct reference:
*
* // instead of transform(ast), pass a copy
* transform(JSON.parse(JSON.stringify(ast));
*
* @param {Object} ast
* @return {Object}
*/
function transform(ast) {
return types.visit(ast, Visitor.visitor);
}
/**
* Transform JavaScript written using ES6 by replacing all template string
* usages with the equivalent ES5.
*
* compile('`Hey, ${name}!'); // '"Hey, " + name + "!"'
*
* @param {string} source
* @param {{sourceFileName: string, sourceMapName: string}} mapOptions
* @return {string}
*/
function compile(source, mapOptions) {
mapOptions = mapOptions || {};
var recastOptions = {
sourceFileName: mapOptions.sourceFileName,
sourceMapName: mapOptions.sourceMapName
};
var ast = recast.parse(source, recastOptions);
return recast.print(transform(ast), recastOptions);
}
module.exports = function() {
var data = '';
return through(write, end);
function write(buf) { data += buf; }
function end() {
this.queue(module.exports.compile(data).code);
this.queue(null);
}
};
module.exports.compile = compile;
module.exports.transform = transform;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0047 ]-- |