Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function fixImportedSourceMap(file, state, callback) {
if (!state.map) {
return callback();
}
state.map.sourcesContent = state.map.sourcesContent || [];
nal.map(state.map.sources, normalizeSourcesAndContent, callback);
function assignSourcesContent(sourceContent, idx) {
state.map.sourcesContent[idx] = sourceContent;
}
function normalizeSourcesAndContent(sourcePath, idx, cb) {
var sourceRoot = state.map.sourceRoot || '';
var sourceContent = state.map.sourcesContent[idx] || null;
if (isRemoteSource(sourcePath)) {
assignSourcesContent(sourceContent, idx);
return cb();
}
if (state.map.sourcesContent[idx]) {
return cb();
function parallel(done) {
nowAndLater.map(args, iterator, extensions, done);
}
function settleParallel(done) {
var onSettled = helpers.onSettled(done);
nowAndLater.map(args, iterator, extensions, onSettled);
}
function parallel(done) {
//遍历tasks数组,将其生命周期和extensions属性关联起来,且将每个task异步化,且并发执行
nowAndLater.map(args, asyncDone, extensions, done);
}
function settleSeries(done) {
var onSettled = helpers.onSettled(done);
nowAndLater.mapSeries(args, iterator, extensions, onSettled);
}
function series(done) {
nowAndLater.mapSeries(args, iterator, extensions, done);
}
function addSourceMaps(file, state, callback) {
var tasks = [
loadSourceMap,
fixImportedSourceMap,
mapsLoaded,
];
function apply(fn, key, cb) {
fn(file, state, cb);
}
nal.mapSeries(tasks, apply, done);
function done() {
callback(null, file);
}
}