[Pkg-javascript-commits] [node-module-deps] 266/444: apply transforms on pre-loaded rec.source
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:48:02 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-module-deps.
commit 6bd3e3874c5d4e4b330d30ee4d48a1daa7653cdb
Author: James Halliday <mail at substack.net>
Date: Mon Jul 21 19:02:51 2014 -0700
apply transforms on pre-loaded rec.source
---
index.js | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/index.js b/index.js
index 8855b07..5e363c1 100644
--- a/index.js
+++ b/index.js
@@ -243,7 +243,13 @@ Deps.prototype.walk = function (id, parent, cb) {
self.resolve(id, parent, function (err, file, pkg) {
if (err && rec.source) {
file = rec.file;
- return fromSource(rec.source);
+
+ var ts = self.getTransforms(file, pkg);
+ ts.pipe(concat(function (body) {
+ rec.source = body.toString('utf8');
+ fromSource(rec.source);
+ }));
+ return ts.end(rec.source);
}
if (err && self.options.ignoreMissing) {
if (-- self.pending === 0) self.push(null);
@@ -257,7 +263,14 @@ Deps.prototype.walk = function (id, parent, cb) {
}
self.visited[file] = true;
- if (rec.source) return fromSource(rec.source);
+ if (rec.source) {
+ var ts = self.getTransforms(file, pkg);
+ ts.pipe(concat(function (body) {
+ rec.source = body.toString('utf8');
+ fromSource(rec.source);
+ }));
+ return ts.end(rec.source);
+ }
var c = self.cache && self.cache[file];
if (c) return fromDeps(file, c.source, c.package, Object.keys(c.deps));
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git
More information about the Pkg-javascript-commits
mailing list