aboutsummaryrefslogtreecommitdiff
path: root/node_modules/vinyl-fs/lib/src/wrapWithVinylFile.js
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-03-27 21:01:33 +0100
commitcc97a4dd2a967e1c2273bd5f4c5f49a5bf2e2585 (patch)
tree92c5d88706a6ffc654d1b133618d357890e7096b /node_modules/vinyl-fs/lib/src/wrapWithVinylFile.js
parent3771b4d6b67b34c130f3a9a1a15f42deefdb2eda (diff)
remove node_modules
Diffstat (limited to 'node_modules/vinyl-fs/lib/src/wrapWithVinylFile.js')
-rw-r--r--node_modules/vinyl-fs/lib/src/wrapWithVinylFile.js51
1 files changed, 0 insertions, 51 deletions
diff --git a/node_modules/vinyl-fs/lib/src/wrapWithVinylFile.js b/node_modules/vinyl-fs/lib/src/wrapWithVinylFile.js
deleted file mode 100644
index 5e6290e59..000000000
--- a/node_modules/vinyl-fs/lib/src/wrapWithVinylFile.js
+++ /dev/null
@@ -1,51 +0,0 @@
-'use strict';
-
-var through2 = require('through2');
-var fs = require('graceful-fs');
-var File = require('vinyl');
-
-function wrapWithVinylFile(options) {
-
- // A stat property is exposed on file objects as a (wanted) side effect
- function resolveFile(globFile, enc, cb) {
- fs.lstat(globFile.path, function(err, stat) {
- if (err) {
- return cb(err);
- }
-
- globFile.stat = stat;
-
- if (!stat.isSymbolicLink() || !options.followSymlinks) {
- var vinylFile = new File(globFile);
- if (globFile.originalSymlinkPath) {
- // If we reach here, it means there is at least one
- // symlink on the path and we need to rewrite the path
- // to its original value.
- // Updated file stats will tell getContents() to actually read it.
- vinylFile.path = globFile.originalSymlinkPath;
- }
- return cb(null, vinylFile);
- }
-
- fs.realpath(globFile.path, function(err, filePath) {
- if (err) {
- return cb(err);
- }
-
- if (!globFile.originalSymlinkPath) {
- // Store the original symlink path before the recursive call
- // to later rewrite it back.
- globFile.originalSymlinkPath = globFile.path;
- }
- globFile.path = filePath;
-
- // Recurse to get real file stat
- resolveFile(globFile, enc, cb);
- });
- });
- }
-
- return through2.obj(options, resolveFile);
-}
-
-module.exports = wrapWithVinylFile;