.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / fast-glob / package / out / adapters / fs-sync.js
1 "use strict";\r
2 var __extends = (this && this.__extends) || (function () {\r
3     var extendStatics = function (d, b) {\r
4         extendStatics = Object.setPrototypeOf ||\r
5             ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r
6             function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r
7         return extendStatics(d, b);\r
8     };\r
9     return function (d, b) {\r
10         extendStatics(d, b);\r
11         function __() { this.constructor = d; }\r
12         d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r
13     };\r
14 })();\r
15 Object.defineProperty(exports, "__esModule", { value: true });\r
16 var fsStat = require("@nodelib/fs.stat");\r
17 var fs_1 = require("./fs");\r
18 var FileSystemSync = /** @class */ (function (_super) {\r
19     __extends(FileSystemSync, _super);\r
20     function FileSystemSync() {\r
21         return _super !== null && _super.apply(this, arguments) || this;\r
22     }\r
23     /**\r
24      * Use sync API to read entries for Task.\r
25      */\r
26     FileSystemSync.prototype.read = function (patterns, filter) {\r
27         var _this = this;\r
28         var entries = [];\r
29         patterns.forEach(function (pattern) {\r
30             var filepath = _this.getFullEntryPath(pattern);\r
31             var entry = _this.getEntry(filepath, pattern);\r
32             if (entry === null || !filter(entry)) {\r
33                 return;\r
34             }\r
35             entries.push(entry);\r
36         });\r
37         return entries;\r
38     };\r
39     /**\r
40      * Return entry for the provided path.\r
41      */\r
42     FileSystemSync.prototype.getEntry = function (filepath, pattern) {\r
43         try {\r
44             var stat = this.getStat(filepath);\r
45             return this.makeEntry(stat, pattern);\r
46         }\r
47         catch (err) {\r
48             return null;\r
49         }\r
50     };\r
51     /**\r
52      * Return fs.Stats for the provided path.\r
53      */\r
54     FileSystemSync.prototype.getStat = function (filepath) {\r
55         return fsStat.statSync(filepath, { throwErrorOnBrokenSymlinks: false });\r
56     };\r
57     return FileSystemSync;\r
58 }(fs_1.default));\r
59 exports.default = FileSystemSync;\r