From 3c51c3be85bb0d1bdb87ea0d6632f1c256912f27 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sun, 6 Oct 2019 21:37:45 +0200 Subject: build: Add some required modules for node --- .../fast-glob/out/providers/filters/deep.d.ts | 45 ++++++++++++ .../fast-glob/out/providers/filters/deep.js | 83 +++++++++++++++++++++ .../fast-glob/out/providers/filters/entry.d.ts | 45 ++++++++++++ .../fast-glob/out/providers/filters/entry.js | 85 ++++++++++++++++++++++ .../fast-glob/out/providers/reader-async.d.ts | 28 +++++++ .../fast-glob/out/providers/reader-async.js | 75 +++++++++++++++++++ .../fast-glob/out/providers/reader-stream.d.ts | 27 +++++++ .../fast-glob/out/providers/reader-stream.js | 83 +++++++++++++++++++++ .../fast-glob/out/providers/reader-sync.d.ts | 27 +++++++ .../fast-glob/out/providers/reader-sync.js | 74 +++++++++++++++++++ node_modules/fast-glob/out/providers/reader.d.ts | 39 ++++++++++ node_modules/fast-glob/out/providers/reader.js | 68 +++++++++++++++++ 12 files changed, 679 insertions(+) create mode 100644 node_modules/fast-glob/out/providers/filters/deep.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/deep.js create mode 100644 node_modules/fast-glob/out/providers/filters/entry.d.ts create mode 100644 node_modules/fast-glob/out/providers/filters/entry.js create mode 100644 node_modules/fast-glob/out/providers/reader-async.d.ts create mode 100644 node_modules/fast-glob/out/providers/reader-async.js create mode 100644 node_modules/fast-glob/out/providers/reader-stream.d.ts create mode 100644 node_modules/fast-glob/out/providers/reader-stream.js create mode 100644 node_modules/fast-glob/out/providers/reader-sync.d.ts create mode 100644 node_modules/fast-glob/out/providers/reader-sync.js create mode 100644 node_modules/fast-glob/out/providers/reader.d.ts create mode 100644 node_modules/fast-glob/out/providers/reader.js (limited to 'node_modules/fast-glob/out/providers') diff --git a/node_modules/fast-glob/out/providers/filters/deep.d.ts b/node_modules/fast-glob/out/providers/filters/deep.d.ts new file mode 100644 index 0000000..2cd02b6 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/deep.d.ts @@ -0,0 +1,45 @@ +import micromatch = require('micromatch'); +import { IOptions } from '../../managers/options'; +import { FilterFunction } from '@mrmlnc/readdir-enhanced'; +import { Pattern } from '../../types/patterns'; +export default class DeepFilter { + private readonly options; + private readonly micromatchOptions; + constructor(options: IOptions, micromatchOptions: micromatch.Options); + /** + * Returns filter for directories. + */ + getFilter(positive: Pattern[], negative: Pattern[]): FilterFunction; + /** + * Returns max depth of the provided patterns. + */ + private getMaxPatternDepth; + /** + * Returns RegExp's for patterns that can affect the depth of reading. + */ + private getNegativePatternsRe; + /** + * Returns «true» for directory that should be read. + */ + private filter; + /** + * Returns «true» when the «deep» option is disabled or number and depth of the entry is greater that the option value. + */ + private isSkippedByDeepOption; + /** + * Returns «true» when depth parameter is not an Infinity and entry depth greater that the parameter value. + */ + private isSkippedByMaxPatternDepth; + /** + * Returns «true» for symlinked directory if the «followSymlinkedDirectories» option is disabled. + */ + private isSkippedSymlinkedDirectory; + /** + * Returns «true» for a directory whose name starts with a period if «dot» option is disabled. + */ + private isSkippedDotDirectory; + /** + * Returns «true» for a directory whose path math to any negative pattern. + */ + private isSkippedByNegativePatterns; +} diff --git a/node_modules/fast-glob/out/providers/filters/deep.js b/node_modules/fast-glob/out/providers/filters/deep.js new file mode 100644 index 0000000..19732e8 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/deep.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var pathUtils = require("../../utils/path"); +var patternUtils = require("../../utils/pattern"); +var DeepFilter = /** @class */ (function () { + function DeepFilter(options, micromatchOptions) { + this.options = options; + this.micromatchOptions = micromatchOptions; + } + /** + * Returns filter for directories. + */ + DeepFilter.prototype.getFilter = function (positive, negative) { + var _this = this; + var maxPatternDepth = this.getMaxPatternDepth(positive); + var negativeRe = this.getNegativePatternsRe(negative); + return function (entry) { return _this.filter(entry, negativeRe, maxPatternDepth); }; + }; + /** + * Returns max depth of the provided patterns. + */ + DeepFilter.prototype.getMaxPatternDepth = function (patterns) { + var globstar = patterns.some(patternUtils.hasGlobStar); + return globstar ? Infinity : patternUtils.getMaxNaivePatternsDepth(patterns); + }; + /** + * Returns RegExp's for patterns that can affect the depth of reading. + */ + DeepFilter.prototype.getNegativePatternsRe = function (patterns) { + var affectDepthOfReadingPatterns = patterns.filter(patternUtils.isAffectDepthOfReadingPattern); + return patternUtils.convertPatternsToRe(affectDepthOfReadingPatterns, this.micromatchOptions); + }; + /** + * Returns «true» for directory that should be read. + */ + DeepFilter.prototype.filter = function (entry, negativeRe, maxPatternDepth) { + if (this.isSkippedByDeepOption(entry.depth)) { + return false; + } + if (this.isSkippedByMaxPatternDepth(entry.depth, maxPatternDepth)) { + return false; + } + if (this.isSkippedSymlinkedDirectory(entry)) { + return false; + } + if (this.isSkippedDotDirectory(entry)) { + return false; + } + return this.isSkippedByNegativePatterns(entry, negativeRe); + }; + /** + * Returns «true» when the «deep» option is disabled or number and depth of the entry is greater that the option value. + */ + DeepFilter.prototype.isSkippedByDeepOption = function (entryDepth) { + return !this.options.deep || (typeof this.options.deep === 'number' && entryDepth >= this.options.deep); + }; + /** + * Returns «true» when depth parameter is not an Infinity and entry depth greater that the parameter value. + */ + DeepFilter.prototype.isSkippedByMaxPatternDepth = function (entryDepth, maxPatternDepth) { + return maxPatternDepth !== Infinity && entryDepth >= maxPatternDepth; + }; + /** + * Returns «true» for symlinked directory if the «followSymlinkedDirectories» option is disabled. + */ + DeepFilter.prototype.isSkippedSymlinkedDirectory = function (entry) { + return !this.options.followSymlinkedDirectories && entry.isSymbolicLink(); + }; + /** + * Returns «true» for a directory whose name starts with a period if «dot» option is disabled. + */ + DeepFilter.prototype.isSkippedDotDirectory = function (entry) { + return !this.options.dot && pathUtils.isDotDirectory(entry.path); + }; + /** + * Returns «true» for a directory whose path math to any negative pattern. + */ + DeepFilter.prototype.isSkippedByNegativePatterns = function (entry, negativeRe) { + return !patternUtils.matchAny(entry.path, negativeRe); + }; + return DeepFilter; +}()); +exports.default = DeepFilter; diff --git a/node_modules/fast-glob/out/providers/filters/entry.d.ts b/node_modules/fast-glob/out/providers/filters/entry.d.ts new file mode 100644 index 0000000..88806af --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/entry.d.ts @@ -0,0 +1,45 @@ +import micromatch = require('micromatch'); +import { IOptions } from '../../managers/options'; +import { FilterFunction } from '@mrmlnc/readdir-enhanced'; +import { Pattern } from '../../types/patterns'; +export default class DeepFilter { + private readonly options; + private readonly micromatchOptions; + readonly index: Map; + constructor(options: IOptions, micromatchOptions: micromatch.Options); + /** + * Returns filter for directories. + */ + getFilter(positive: Pattern[], negative: Pattern[]): FilterFunction; + /** + * Returns true if entry must be added to result. + */ + private filter; + /** + * Return true if the entry already has in the cross reader index. + */ + private isDuplicateEntry; + /** + * Create record in the cross reader index. + */ + private createIndexRecord; + /** + * Returns true for non-files if the «onlyFiles» option is enabled. + */ + private onlyFileFilter; + /** + * Returns true for non-directories if the «onlyDirectories» option is enabled. + */ + private onlyDirectoryFilter; + /** + * Return true when `absolute` option is enabled and matched to the negative patterns. + */ + private isSkippedByAbsoluteNegativePatterns; + /** + * Return true when entry match to provided patterns. + * + * First, just trying to apply patterns to the path. + * Second, trying to apply patterns to the path with final slash (need to micromatch to support «directory/**» patterns). + */ + private isMatchToPatterns; +} diff --git a/node_modules/fast-glob/out/providers/filters/entry.js b/node_modules/fast-glob/out/providers/filters/entry.js new file mode 100644 index 0000000..aa68541 --- /dev/null +++ b/node_modules/fast-glob/out/providers/filters/entry.js @@ -0,0 +1,85 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var pathUtils = require("../../utils/path"); +var patternUtils = require("../../utils/pattern"); +var DeepFilter = /** @class */ (function () { + function DeepFilter(options, micromatchOptions) { + this.options = options; + this.micromatchOptions = micromatchOptions; + this.index = new Map(); + } + /** + * Returns filter for directories. + */ + DeepFilter.prototype.getFilter = function (positive, negative) { + var _this = this; + var positiveRe = patternUtils.convertPatternsToRe(positive, this.micromatchOptions); + var negativeRe = patternUtils.convertPatternsToRe(negative, this.micromatchOptions); + return function (entry) { return _this.filter(entry, positiveRe, negativeRe); }; + }; + /** + * Returns true if entry must be added to result. + */ + DeepFilter.prototype.filter = function (entry, positiveRe, negativeRe) { + // Exclude duplicate results + if (this.options.unique) { + if (this.isDuplicateEntry(entry)) { + return false; + } + this.createIndexRecord(entry); + } + // Filter files and directories by options + if (this.onlyFileFilter(entry) || this.onlyDirectoryFilter(entry)) { + return false; + } + if (this.isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) { + return false; + } + return this.isMatchToPatterns(entry.path, positiveRe) && !this.isMatchToPatterns(entry.path, negativeRe); + }; + /** + * Return true if the entry already has in the cross reader index. + */ + DeepFilter.prototype.isDuplicateEntry = function (entry) { + return this.index.has(entry.path); + }; + /** + * Create record in the cross reader index. + */ + DeepFilter.prototype.createIndexRecord = function (entry) { + this.index.set(entry.path, undefined); + }; + /** + * Returns true for non-files if the «onlyFiles» option is enabled. + */ + DeepFilter.prototype.onlyFileFilter = function (entry) { + return this.options.onlyFiles && !entry.isFile(); + }; + /** + * Returns true for non-directories if the «onlyDirectories» option is enabled. + */ + DeepFilter.prototype.onlyDirectoryFilter = function (entry) { + return this.options.onlyDirectories && !entry.isDirectory(); + }; + /** + * Return true when `absolute` option is enabled and matched to the negative patterns. + */ + DeepFilter.prototype.isSkippedByAbsoluteNegativePatterns = function (entry, negativeRe) { + if (!this.options.absolute) { + return false; + } + var fullpath = pathUtils.makeAbsolute(this.options.cwd, entry.path); + return this.isMatchToPatterns(fullpath, negativeRe); + }; + /** + * Return true when entry match to provided patterns. + * + * First, just trying to apply patterns to the path. + * Second, trying to apply patterns to the path with final slash (need to micromatch to support «directory/**» patterns). + */ + DeepFilter.prototype.isMatchToPatterns = function (filepath, patternsRe) { + return patternUtils.matchAny(filepath, patternsRe) || patternUtils.matchAny(filepath + '/', patternsRe); + }; + return DeepFilter; +}()); +exports.default = DeepFilter; diff --git a/node_modules/fast-glob/out/providers/reader-async.d.ts b/node_modules/fast-glob/out/providers/reader-async.d.ts new file mode 100644 index 0000000..eacdee3 --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader-async.d.ts @@ -0,0 +1,28 @@ +/// +import * as readdir from '@mrmlnc/readdir-enhanced'; +import Reader from './reader'; +import FileSystemStream from '../adapters/fs-stream'; +import { ITask } from '../managers/tasks'; +import { EntryItem } from '../types/entries'; +export default class ReaderAsync extends Reader> { + /** + * Returns FileSystem adapter. + */ + readonly fsAdapter: FileSystemStream; + /** + * Use async API to read entries for Task. + */ + read(task: ITask): Promise; + /** + * Returns founded paths. + */ + api(root: string, task: ITask, options: readdir.Options): NodeJS.ReadableStream; + /** + * Api for dynamic tasks. + */ + dynamicApi(root: string, options: readdir.Options): NodeJS.ReadableStream; + /** + * Api for static tasks. + */ + staticApi(task: ITask, options: readdir.Options): NodeJS.ReadableStream; +} diff --git a/node_modules/fast-glob/out/providers/reader-async.js b/node_modules/fast-glob/out/providers/reader-async.js new file mode 100644 index 0000000..cdd6099 --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader-async.js @@ -0,0 +1,75 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var readdir = require("@mrmlnc/readdir-enhanced"); +var reader_1 = require("./reader"); +var fs_stream_1 = require("../adapters/fs-stream"); +var ReaderAsync = /** @class */ (function (_super) { + __extends(ReaderAsync, _super); + function ReaderAsync() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderAsync.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_stream_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use async API to read entries for Task. + */ + ReaderAsync.prototype.read = function (task) { + var _this = this; + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + var entries = []; + return new Promise(function (resolve, reject) { + var stream = _this.api(root, task, options); + stream.on('error', function (err) { + _this.isEnoentCodeError(err) ? resolve([]) : reject(err); + stream.pause(); + }); + stream.on('data', function (entry) { return entries.push(_this.transform(entry)); }); + stream.on('end', function () { return resolve(entries); }); + }); + }; + /** + * Returns founded paths. + */ + ReaderAsync.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderAsync.prototype.dynamicApi = function (root, options) { + return readdir.readdirStreamStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderAsync.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderAsync; +}(reader_1.default)); +exports.default = ReaderAsync; diff --git a/node_modules/fast-glob/out/providers/reader-stream.d.ts b/node_modules/fast-glob/out/providers/reader-stream.d.ts new file mode 100644 index 0000000..ebe0d5b --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader-stream.d.ts @@ -0,0 +1,27 @@ +/// +import * as readdir from '@mrmlnc/readdir-enhanced'; +import Reader from './reader'; +import FileSystemStream from '../adapters/fs-stream'; +import { ITask } from '../managers/tasks'; +export default class ReaderStream extends Reader { + /** + * Returns FileSystem adapter. + */ + readonly fsAdapter: FileSystemStream; + /** + * Use stream API to read entries for Task. + */ + read(task: ITask): NodeJS.ReadableStream; + /** + * Returns founded paths. + */ + api(root: string, task: ITask, options: readdir.Options): NodeJS.ReadableStream; + /** + * Api for dynamic tasks. + */ + dynamicApi(root: string, options: readdir.Options): NodeJS.ReadableStream; + /** + * Api for static tasks. + */ + staticApi(task: ITask, options: readdir.Options): NodeJS.ReadableStream; +} diff --git a/node_modules/fast-glob/out/providers/reader-stream.js b/node_modules/fast-glob/out/providers/reader-stream.js new file mode 100644 index 0000000..fd4493d --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader-stream.js @@ -0,0 +1,83 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var stream = require("stream"); +var readdir = require("@mrmlnc/readdir-enhanced"); +var reader_1 = require("./reader"); +var fs_stream_1 = require("../adapters/fs-stream"); +var TransformStream = /** @class */ (function (_super) { + __extends(TransformStream, _super); + function TransformStream(reader) { + var _this = _super.call(this, { objectMode: true }) || this; + _this.reader = reader; + return _this; + } + TransformStream.prototype._transform = function (entry, _encoding, callback) { + callback(null, this.reader.transform(entry)); + }; + return TransformStream; +}(stream.Transform)); +var ReaderStream = /** @class */ (function (_super) { + __extends(ReaderStream, _super); + function ReaderStream() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderStream.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_stream_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use stream API to read entries for Task. + */ + ReaderStream.prototype.read = function (task) { + var _this = this; + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + var transform = new TransformStream(this); + var readable = this.api(root, task, options); + return readable + .on('error', function (err) { return _this.isEnoentCodeError(err) ? null : transform.emit('error', err); }) + .pipe(transform); + }; + /** + * Returns founded paths. + */ + ReaderStream.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderStream.prototype.dynamicApi = function (root, options) { + return readdir.readdirStreamStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderStream.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderStream; +}(reader_1.default)); +exports.default = ReaderStream; diff --git a/node_modules/fast-glob/out/providers/reader-sync.d.ts b/node_modules/fast-glob/out/providers/reader-sync.d.ts new file mode 100644 index 0000000..07e16ea --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader-sync.d.ts @@ -0,0 +1,27 @@ +import * as readdir from '@mrmlnc/readdir-enhanced'; +import Reader from './reader'; +import FileSystemSync from '../adapters/fs-sync'; +import { ITask } from '../managers/tasks'; +import { Entry, EntryItem } from '../types/entries'; +export default class ReaderSync extends Reader { + /** + * Returns FileSystem adapter. + */ + readonly fsAdapter: FileSystemSync; + /** + * Use sync API to read entries for Task. + */ + read(task: ITask): EntryItem[]; + /** + * Returns founded paths. + */ + api(root: string, task: ITask, options: readdir.Options): Entry[]; + /** + * Api for dynamic tasks. + */ + dynamicApi(root: string, options: readdir.Options): Entry[]; + /** + * Api for static tasks. + */ + staticApi(task: ITask, options: readdir.Options): Entry[]; +} diff --git a/node_modules/fast-glob/out/providers/reader-sync.js b/node_modules/fast-glob/out/providers/reader-sync.js new file mode 100644 index 0000000..74b5e76 --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader-sync.js @@ -0,0 +1,74 @@ +"use strict"; +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var readdir = require("@mrmlnc/readdir-enhanced"); +var reader_1 = require("./reader"); +var fs_sync_1 = require("../adapters/fs-sync"); +var ReaderSync = /** @class */ (function (_super) { + __extends(ReaderSync, _super); + function ReaderSync() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderSync.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_sync_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use sync API to read entries for Task. + */ + ReaderSync.prototype.read = function (task) { + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + try { + var entries = this.api(root, task, options); + return entries.map(this.transform, this); + } + catch (err) { + if (this.isEnoentCodeError(err)) { + return []; + } + throw err; + } + }; + /** + * Returns founded paths. + */ + ReaderSync.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderSync.prototype.dynamicApi = function (root, options) { + return readdir.readdirSyncStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderSync.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderSync; +}(reader_1.default)); +exports.default = ReaderSync; diff --git a/node_modules/fast-glob/out/providers/reader.d.ts b/node_modules/fast-glob/out/providers/reader.d.ts new file mode 100644 index 0000000..ce6ba61 --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader.d.ts @@ -0,0 +1,39 @@ +/// +import micromatch = require('micromatch'); +import DeepFilter from './filters/deep'; +import EntryFilter from './filters/entry'; +import { IOptions } from '../managers/options'; +import { ITask } from '../managers/tasks'; +import { Options as IReaddirOptions } from '@mrmlnc/readdir-enhanced'; +import { Entry, EntryItem } from '../types/entries'; +export default abstract class Reader { + readonly options: IOptions; + readonly entryFilter: EntryFilter; + readonly deepFilter: DeepFilter; + private readonly micromatchOptions; + constructor(options: IOptions); + /** + * The main logic of reading the directories that must be implemented by each providers. + */ + abstract read(_task: ITask): T; + /** + * Returns root path to scanner. + */ + getRootDirectory(task: ITask): string; + /** + * Returns options for reader. + */ + getReaderOptions(task: ITask): IReaddirOptions; + /** + * Returns options for micromatch. + */ + getMicromatchOptions(): micromatch.Options; + /** + * Returns transformed entry. + */ + transform(entry: Entry): EntryItem; + /** + * Returns true if error has ENOENT code. + */ + isEnoentCodeError(err: NodeJS.ErrnoException): boolean; +} diff --git a/node_modules/fast-glob/out/providers/reader.js b/node_modules/fast-glob/out/providers/reader.js new file mode 100644 index 0000000..8e187dd --- /dev/null +++ b/node_modules/fast-glob/out/providers/reader.js @@ -0,0 +1,68 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var path = require("path"); +var deep_1 = require("./filters/deep"); +var entry_1 = require("./filters/entry"); +var pathUtil = require("../utils/path"); +var Reader = /** @class */ (function () { + function Reader(options) { + this.options = options; + this.micromatchOptions = this.getMicromatchOptions(); + this.entryFilter = new entry_1.default(options, this.micromatchOptions); + this.deepFilter = new deep_1.default(options, this.micromatchOptions); + } + /** + * Returns root path to scanner. + */ + Reader.prototype.getRootDirectory = function (task) { + return path.resolve(this.options.cwd, task.base); + }; + /** + * Returns options for reader. + */ + Reader.prototype.getReaderOptions = function (task) { + return { + basePath: task.base === '.' ? '' : task.base, + filter: this.entryFilter.getFilter(task.positive, task.negative), + deep: this.deepFilter.getFilter(task.positive, task.negative), + sep: '/' + }; + }; + /** + * Returns options for micromatch. + */ + Reader.prototype.getMicromatchOptions = function () { + return { + dot: this.options.dot, + nobrace: !this.options.brace, + noglobstar: !this.options.globstar, + noext: !this.options.extension, + nocase: !this.options.case, + matchBase: this.options.matchBase + }; + }; + /** + * Returns transformed entry. + */ + Reader.prototype.transform = function (entry) { + if (this.options.absolute && !path.isAbsolute(entry.path)) { + entry.path = pathUtil.makeAbsolute(this.options.cwd, entry.path); + } + if (this.options.markDirectories && entry.isDirectory()) { + entry.path += '/'; + } + var item = this.options.stats ? entry : entry.path; + if (this.options.transform === null) { + return item; + } + return this.options.transform(item); + }; + /** + * Returns true if error has ENOENT code. + */ + Reader.prototype.isEnoentCodeError = function (err) { + return err.code === 'ENOENT'; + }; + return Reader; +}()); +exports.default = Reader; -- cgit v1.2.3