Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
3 | const path = require("path");
|
---|
4 | const fsStat = require("@nodelib/fs.stat");
|
---|
5 | const utils = require("../utils");
|
---|
6 | class Reader {
|
---|
7 | constructor(_settings) {
|
---|
8 | this._settings = _settings;
|
---|
9 | this._fsStatSettings = new fsStat.Settings({
|
---|
10 | followSymbolicLink: this._settings.followSymbolicLinks,
|
---|
11 | fs: this._settings.fs,
|
---|
12 | throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
|
---|
13 | });
|
---|
14 | }
|
---|
15 | _getFullEntryPath(filepath) {
|
---|
16 | return path.resolve(this._settings.cwd, filepath);
|
---|
17 | }
|
---|
18 | _makeEntry(stats, pattern) {
|
---|
19 | const entry = {
|
---|
20 | name: pattern,
|
---|
21 | path: pattern,
|
---|
22 | dirent: utils.fs.createDirentFromStats(pattern, stats)
|
---|
23 | };
|
---|
24 | if (this._settings.stats) {
|
---|
25 | entry.stats = stats;
|
---|
26 | }
|
---|
27 | return entry;
|
---|
28 | }
|
---|
29 | _isFatalError(error) {
|
---|
30 | return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
|
---|
31 | }
|
---|
32 | }
|
---|
33 | exports.default = Reader;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.