.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / fast-glob / package / out / adapters / fs-stream.js
diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/fast-glob/package/out/adapters/fs-stream.js b/.config/coc/extensions/node_modules/coc-prettier/node_modules/fast-glob/package/out/adapters/fs-stream.js
new file mode 100644 (file)
index 0000000..445f7b9
--- /dev/null
@@ -0,0 +1,64 @@
+"use strict";\r
+var __extends = (this && this.__extends) || (function () {\r
+    var extendStatics = function (d, b) {\r
+        extendStatics = Object.setPrototypeOf ||\r
+            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r
+            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r
+        return extendStatics(d, b);\r
+    };\r
+    return function (d, b) {\r
+        extendStatics(d, b);\r
+        function __() { this.constructor = d; }\r
+        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r
+    };\r
+})();\r
+Object.defineProperty(exports, "__esModule", { value: true });\r
+var stream = require("stream");\r
+var fsStat = require("@nodelib/fs.stat");\r
+var fs_1 = require("./fs");\r
+var FileSystemStream = /** @class */ (function (_super) {\r
+    __extends(FileSystemStream, _super);\r
+    function FileSystemStream() {\r
+        return _super !== null && _super.apply(this, arguments) || this;\r
+    }\r
+    /**\r
+     * Use stream API to read entries for Task.\r
+     */\r
+    FileSystemStream.prototype.read = function (patterns, filter) {\r
+        var _this = this;\r
+        var filepaths = patterns.map(this.getFullEntryPath, this);\r
+        var transform = new stream.Transform({ objectMode: true });\r
+        transform._transform = function (index, _enc, done) {\r
+            return _this.getEntry(filepaths[index], patterns[index]).then(function (entry) {\r
+                if (entry !== null && filter(entry)) {\r
+                    transform.push(entry);\r
+                }\r
+                if (index === filepaths.length - 1) {\r
+                    transform.end();\r
+                }\r
+                done();\r
+            });\r
+        };\r
+        for (var i = 0; i < filepaths.length; i++) {\r
+            transform.write(i);\r
+        }\r
+        return transform;\r
+    };\r
+    /**\r
+     * Return entry for the provided path.\r
+     */\r
+    FileSystemStream.prototype.getEntry = function (filepath, pattern) {\r
+        var _this = this;\r
+        return this.getStat(filepath)\r
+            .then(function (stat) { return _this.makeEntry(stat, pattern); })\r
+            .catch(function () { return null; });\r
+    };\r
+    /**\r
+     * Return fs.Stats for the provided path.\r
+     */\r
+    FileSystemStream.prototype.getStat = function (filepath) {\r
+        return fsStat.stat(filepath, { throwErrorOnBrokenSymlinks: false });\r
+    };\r
+    return FileSystemStream;\r
+}(fs_1.default));\r
+exports.default = FileSystemStream;\r