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
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
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
24 * Use sync API to read entries for Task.
\r
26 FileSystemSync.prototype.read = function (patterns, filter) {
\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
35 entries.push(entry);
\r
40 * Return entry for the provided path.
\r
42 FileSystemSync.prototype.getEntry = function (filepath, pattern) {
\r
44 var stat = this.getStat(filepath);
\r
45 return this.makeEntry(stat, pattern);
\r
52 * Return fs.Stats for the provided path.
\r
54 FileSystemSync.prototype.getStat = function (filepath) {
\r
55 return fsStat.statSync(filepath, { throwErrorOnBrokenSymlinks: false });
\r
57 return FileSystemSync;
\r
59 exports.default = FileSystemSync;
\r