From daeb0b17468f5667af60fecef93133805a4d0ef9 Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Sat, 17 Jun 2017 08:51:45 -0700 Subject: [PATCH] Update: Replace async dependency with now-and-later (closes #23) --- lib/helpers.js | 10 +++++++--- package.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/helpers.js b/lib/helpers.js index a045d91..0a9b6a6 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -4,9 +4,9 @@ var path = require('path'); var fs = require('graceful-fs'); var File = require('vinyl'); -var async = require('async'); var convert = require('convert-source-map'); var fileNormalize = require('file-normalize'); +var nal = require('now-and-later'); var stripBom = fileNormalize.stripBOM; var appendBuffer = fileNormalize.appendBuffer; @@ -76,7 +76,7 @@ function fixImportedSourceMap(file, state, callback) { state.map.sourcesContent = state.map.sourcesContent || []; - async.eachOf(state.map.sources, normalizeSourcesAndContent, callback); + nal.map(state.map.sources, normalizeSourcesAndContent, callback); function assignSourcesContent(sourceContent, idx) { state.map.sourcesContent[idx] = sourceContent; @@ -152,7 +152,11 @@ function addSourceMaps(file, state, callback) { mapsLoaded, ]; - async.applyEachSeries(tasks, file, state, done); + function apply(fn, key, cb) { + fn(file, state, cb); + } + + nal.mapSeries(tasks, apply, done); function done(err) { if (err) { diff --git a/package.json b/package.json index 4d3ce75..bb661ac 100644 --- a/package.json +++ b/package.json @@ -26,10 +26,10 @@ "coveralls": "npm run cover && istanbul-coveralls" }, "dependencies": { - "async": "^2.1.4", "convert-source-map": "^1.5.0", "file-normalize": "^1.1.0", "graceful-fs": "^4.1.6", + "now-and-later": "^2.0.0", "object.defaults": "^1.0.0", "vinyl": "^2.0.0" },