source: trip-planner-front/node_modules/fast-glob/out/providers/provider.js@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.0 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const path = require("path");
4const deep_1 = require("./filters/deep");
5const entry_1 = require("./filters/entry");
6const error_1 = require("./filters/error");
7const entry_2 = require("./transformers/entry");
8class Provider {
9 constructor(_settings) {
10 this._settings = _settings;
11 this.errorFilter = new error_1.default(this._settings);
12 this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
13 this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
14 this.entryTransformer = new entry_2.default(this._settings);
15 }
16 _getRootDirectory(task) {
17 return path.resolve(this._settings.cwd, task.base);
18 }
19 _getReaderOptions(task) {
20 const basePath = task.base === '.' ? '' : task.base;
21 return {
22 basePath,
23 pathSegmentSeparator: '/',
24 concurrency: this._settings.concurrency,
25 deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
26 entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
27 errorFilter: this.errorFilter.getFilter(),
28 followSymbolicLinks: this._settings.followSymbolicLinks,
29 fs: this._settings.fs,
30 stats: this._settings.stats,
31 throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
32 transform: this.entryTransformer.getTransformer()
33 };
34 }
35 _getMicromatchOptions() {
36 return {
37 dot: this._settings.dot,
38 matchBase: this._settings.baseNameMatch,
39 nobrace: !this._settings.braceExpansion,
40 nocase: !this._settings.caseSensitiveMatch,
41 noext: !this._settings.extglob,
42 noglobstar: !this._settings.globstar,
43 posix: true,
44 strictSlashes: false
45 };
46 }
47}
48exports.default = Provider;
Note: See TracBrowser for help on using the repository browser.