Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// modules: 'amd',
stage: 0
}).code;
var progressTracker = '__track$loop__'
function removeMerp(src){
console.log('removing merp', src)
return falafel(src, function(node){
if(node.type == 'CallExpression' &&
node.callee.type == 'Identifier' &&
node.callee.name == progressTracker){
node.update('0')
}
}).toString()
}
var result = falafel(middle, function (node) {
if(node.type === 'ForStatement'){
if(node.test.type == 'BinaryExpression' &&
node.test.right.type == 'Literal' &&
node.test.left.type == 'Identifier' &&
node.test.operator == '<'){
node.update.update(node.update.source() + ','+progressTracker+'(' + node.test.left.name + ', ' + node.test.right.value + ')')
node.body.update(removeMerp(node.body.source()))
}
}else if(node.type === 'CallExpression'){
if(node.callee.type == 'MemberExpression' &&
['forEach', 'map'].indexOf(node.callee.property.name) != -1 &&
node.arguments[0].type == 'FunctionExpression') {
var thing = node.arguments[0].body;
thing.update('{'+progressTracker+'(arguments[1], arguments[2].length);' + thing.source().slice(1))
// removeMerp(
}
function removeMerp(src){
console.log('removing merp', src)
return falafel(src, function(node){
if(node.type == 'CallExpression' &&
node.callee.type == 'Identifier' &&
node.callee.name == progressTracker){
node.update('0')
}
}).toString()
}
var result = falafel(middle, function (node) {
export default function(source, file, options) {
const consumerPaths = options.layers.map(layer => layer.path).concat(options.consumers || []);
const isFileInheritable = consumerPaths.some(layerPath => {
return file.indexOf(layerPath) === 0;
});
if (!isFileInheritable) {
return Promise.resolve(source);
}
const requiresPromises = [];
const out = falafel(source, node => {
if (
node.type === 'CallExpression' &&
node.callee.type === 'Identifier' &&
node.callee.name === 'require' &&
node.arguments[0].value.charAt(0) === '#'
) {
const rawRequireValue = node.arguments[0].value;
requiresPromises.push(
getResults(rawRequireValue, file, options.layers).then(origResult => {
const result = {
...origResult
};
if (result.component) {
result.component = stringifyRequest(this, result.component).replace(/"/g, '');
export default function(source) {
if (this.cacheable) {
this.cacheable();
}
const result = falafel(source, node => {
if (
node.type === 'CallExpression' &&
node.callee.type === 'Identifier' &&
node.callee.name === 'require'
) {
const value = node.arguments[0].value;
node.update(`typeof __inject__('${value}') !== 'undefined' ? __inject__('${value}') : require('${value}')`);
}
});
return `
exports['default'] = function(__injections__) {
var exports = {};
function __inject__(value) {