This commit is contained in:
tatianamac
2019-11-26 14:50:43 -08:00
parent 8a55660ed0
commit 6d5445ecc5
13894 changed files with 2233957 additions and 0 deletions

27
node_modules/fast-glob/out/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,27 @@
/// <reference types="node" />
import * as taskManager from './managers/tasks';
import { Options as OptionsInternal } from './settings';
import { Entry as EntryInternal, FileSystemAdapter as FileSystemAdapterInternal, Pattern as PatternInternal } from './types';
declare type EntryObjectModePredicate = {
[TKey in keyof Pick<OptionsInternal, 'objectMode'>]-?: true;
};
declare type EntryStatsPredicate = {
[TKey in keyof Pick<OptionsInternal, 'stats'>]-?: true;
};
declare type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate;
declare function FastGlob(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): Promise<EntryInternal[]>;
declare function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise<string[]>;
declare namespace FastGlob {
type Options = OptionsInternal;
type Entry = EntryInternal;
type Task = taskManager.Task;
type Pattern = PatternInternal;
type FileSystemAdapter = FileSystemAdapterInternal;
function sync(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): EntryInternal[];
function sync(source: PatternInternal | PatternInternal[], options?: OptionsInternal): string[];
function stream(source: PatternInternal | PatternInternal[], options?: OptionsInternal): NodeJS.ReadableStream;
function generateTasks(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Task[];
function isDynamicPattern(source: PatternInternal, options?: OptionsInternal): boolean;
function escapePath(source: PatternInternal): PatternInternal;
}
export = FastGlob;

73
node_modules/fast-glob/out/index.js generated vendored Normal file
View File

@@ -0,0 +1,73 @@
"use strict";
const taskManager = require("./managers/tasks");
const async_1 = require("./providers/async");
const stream_1 = require("./providers/stream");
const sync_1 = require("./providers/sync");
const settings_1 = require("./settings");
const utils = require("./utils");
function FastGlob(source, options) {
try {
assertPatternsInput(source);
}
catch (error) {
return Promise.reject(error);
}
const works = getWorks(source, async_1.default, options);
return Promise.all(works).then(utils.array.flatten);
}
// https://github.com/typescript-eslint/typescript-eslint/issues/60
// eslint-disable-next-line no-redeclare
(function (FastGlob) {
function sync(source, options) {
assertPatternsInput(source);
const works = getWorks(source, sync_1.default, options);
return utils.array.flatten(works);
}
FastGlob.sync = sync;
function stream(source, options) {
assertPatternsInput(source);
const works = getWorks(source, stream_1.default, options);
/**
* The stream returned by the provider cannot work with an asynchronous iterator.
* To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
* This affects performance (+25%). I don't see best solution right now.
*/
return utils.stream.merge(works);
}
FastGlob.stream = stream;
function generateTasks(source, options) {
assertPatternsInput(source);
const patterns = [].concat(source);
const settings = new settings_1.default(options);
return taskManager.generate(patterns, settings);
}
FastGlob.generateTasks = generateTasks;
function isDynamicPattern(source, options) {
assertPatternsInput(source);
const settings = new settings_1.default(options);
return utils.pattern.isDynamicPattern(source, settings);
}
FastGlob.isDynamicPattern = isDynamicPattern;
function escapePath(source) {
assertPatternsInput(source);
return utils.path.escape(source);
}
FastGlob.escapePath = escapePath;
})(FastGlob || (FastGlob = {}));
function getWorks(source, _Provider, options) {
const patterns = [].concat(source);
const settings = new settings_1.default(options);
const tasks = taskManager.generate(patterns, settings);
const provider = new _Provider(settings);
return tasks.map(provider.read, provider);
}
function assertPatternsInput(source) {
if ([].concat(source).every(isString)) {
return;
}
throw new TypeError('Patterns must be a string or an array of strings');
}
function isString(source) {
return typeof source === 'string';
}
module.exports = FastGlob;

16
node_modules/fast-glob/out/managers/tasks.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import Settings from '../settings';
import { Pattern, PatternsGroup } from '../types';
export declare type Task = {
base: string;
dynamic: boolean;
patterns: Pattern[];
positive: Pattern[];
negative: Pattern[];
};
export declare function generate(patterns: Pattern[], settings: Settings): Task[];
export declare function convertPatternsToTasks(positive: Pattern[], negative: Pattern[], dynamic: boolean): Task[];
export declare function getPositivePatterns(patterns: Pattern[]): Pattern[];
export declare function getNegativePatternsAsPositive(patterns: Pattern[], ignore: Pattern[]): Pattern[];
export declare function groupPatternsByBaseDirectory(patterns: Pattern[]): PatternsGroup;
export declare function convertPatternGroupsToTasks(positive: PatternsGroup, negative: Pattern[], dynamic: boolean): Task[];
export declare function convertPatternGroupToTask(base: string, positive: Pattern[], negative: Pattern[], dynamic: boolean): Task;

64
node_modules/fast-glob/out/managers/tasks.js generated vendored Normal file
View File

@@ -0,0 +1,64 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("../utils");
function generate(patterns, settings) {
const positivePatterns = getPositivePatterns(patterns);
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
return staticTasks.concat(dynamicTasks);
}
exports.generate = generate;
function convertPatternsToTasks(positive, negative, dynamic) {
const positivePatternsGroup = groupPatternsByBaseDirectory(positive);
// When we have a global group there is no reason to divide the patterns into independent tasks.
// In this case, the global task covers the rest.
if ('.' in positivePatternsGroup) {
const task = convertPatternGroupToTask('.', positive, negative, dynamic);
return [task];
}
return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic);
}
exports.convertPatternsToTasks = convertPatternsToTasks;
function getPositivePatterns(patterns) {
return utils.pattern.getPositivePatterns(patterns);
}
exports.getPositivePatterns = getPositivePatterns;
function getNegativePatternsAsPositive(patterns, ignore) {
const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
const positive = negative.map(utils.pattern.convertToPositivePattern);
return positive;
}
exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
function groupPatternsByBaseDirectory(patterns) {
const group = {};
return patterns.reduce((collection, pattern) => {
const base = utils.pattern.getBaseDirectory(pattern);
if (base in collection) {
collection[base].push(pattern);
}
else {
collection[base] = [pattern];
}
return collection;
}, group);
}
exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
function convertPatternGroupsToTasks(positive, negative, dynamic) {
return Object.keys(positive).map((base) => {
return convertPatternGroupToTask(base, positive[base], negative, dynamic);
});
}
exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
function convertPatternGroupToTask(base, positive, negative, dynamic) {
return {
dynamic,
positive,
negative,
base,
patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
};
}
exports.convertPatternGroupToTask = convertPatternGroupToTask;

10
node_modules/fast-glob/out/providers/async.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
/// <reference types="node" />
import { Task } from '../managers/tasks';
import ReaderStream from '../readers/stream';
import { EntryItem, ReaderOptions } from '../types';
import Provider from './provider';
export default class ProviderAsync extends Provider<Promise<EntryItem[]>> {
protected _reader: ReaderStream;
read(task: Task): Promise<EntryItem[]>;
api(root: string, task: Task, options: ReaderOptions): NodeJS.ReadableStream;
}

28
node_modules/fast-glob/out/providers/async.js generated vendored Normal file
View File

@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = require("../readers/stream");
const provider_1 = require("./provider");
class ProviderAsync extends provider_1.default {
constructor() {
super(...arguments);
this._reader = new stream_1.default(this._settings);
}
read(task) {
const root = this._getRootDirectory(task);
const options = this._getReaderOptions(task);
const entries = [];
return new Promise((resolve, reject) => {
const stream = this.api(root, task, options);
stream.once('error', reject);
stream.on('data', (entry) => entries.push(options.transform(entry)));
stream.once('end', () => resolve(entries));
});
}
api(root, task, options) {
if (task.dynamic) {
return this._reader.dynamic(root, options);
}
return this._reader.static(task.patterns, options);
}
}
exports.default = ProviderAsync;

16
node_modules/fast-glob/out/providers/filters/deep.d.ts generated vendored Normal file
View File

@@ -0,0 +1,16 @@
import Settings from '../../settings';
import { EntryFilterFunction, MicromatchOptions, Pattern } from '../../types';
export default class DeepFilter {
private readonly _settings;
private readonly _micromatchOptions;
constructor(_settings: Settings, _micromatchOptions: MicromatchOptions);
getFilter(basePath: string, positive: Pattern[], negative: Pattern[]): EntryFilterFunction;
private _getMaxPatternDepth;
private _getNegativePatternsRe;
private _filter;
private _getEntryDepth;
private _isSkippedByDeep;
private _isSkippedByMaxPatternDepth;
private _isSkippedSymbolicLink;
private _isSkippedByNegativePatterns;
}

53
node_modules/fast-glob/out/providers/filters/deep.js generated vendored Normal file
View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("../../utils");
class DeepFilter {
constructor(_settings, _micromatchOptions) {
this._settings = _settings;
this._micromatchOptions = _micromatchOptions;
}
getFilter(basePath, positive, negative) {
const maxPatternDepth = this._getMaxPatternDepth(positive);
const negativeRe = this._getNegativePatternsRe(negative);
return (entry) => this._filter(basePath, entry, negativeRe, maxPatternDepth);
}
_getMaxPatternDepth(patterns) {
const globstar = patterns.some(utils.pattern.hasGlobStar);
return globstar ? Infinity : utils.pattern.getMaxNaivePatternsDepth(patterns);
}
_getNegativePatternsRe(patterns) {
const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
}
_filter(basePath, entry, negativeRe, maxPatternDepth) {
const depth = this._getEntryDepth(basePath, entry.path);
if (this._isSkippedByDeep(depth)) {
return false;
}
if (this._isSkippedByMaxPatternDepth(depth, maxPatternDepth)) {
return false;
}
if (this._isSkippedSymbolicLink(entry)) {
return false;
}
return this._isSkippedByNegativePatterns(entry, negativeRe);
}
_getEntryDepth(basePath, entryPath) {
const basePathDepth = basePath.split('/').length;
const entryPathDepth = entryPath.split('/').length;
return entryPathDepth - (basePath === '' ? 0 : basePathDepth);
}
_isSkippedByDeep(entryDepth) {
return entryDepth >= this._settings.deep;
}
_isSkippedByMaxPatternDepth(entryDepth, maxPatternDepth) {
return !this._settings.baseNameMatch && maxPatternDepth !== Infinity && entryDepth > maxPatternDepth;
}
_isSkippedSymbolicLink(entry) {
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
}
_isSkippedByNegativePatterns(entry, negativeRe) {
return !utils.pattern.matchAny(entry.path, negativeRe);
}
}
exports.default = DeepFilter;

View File

@@ -0,0 +1,16 @@
import Settings from '../../settings';
import { EntryFilterFunction, MicromatchOptions, Pattern } from '../../types';
export default class EntryFilter {
private readonly _settings;
private readonly _micromatchOptions;
readonly index: Map<string, undefined>;
constructor(_settings: Settings, _micromatchOptions: MicromatchOptions);
getFilter(positive: Pattern[], negative: Pattern[]): EntryFilterFunction;
private _filter;
private _isDuplicateEntry;
private _createIndexRecord;
private _onlyFileFilter;
private _onlyDirectoryFilter;
private _isSkippedByAbsoluteNegativePatterns;
private _isMatchToPatterns;
}

54
node_modules/fast-glob/out/providers/filters/entry.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("../../utils");
class EntryFilter {
constructor(_settings, _micromatchOptions) {
this._settings = _settings;
this._micromatchOptions = _micromatchOptions;
this.index = new Map();
}
getFilter(positive, negative) {
const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
return (entry) => this._filter(entry, positiveRe, negativeRe);
}
_filter(entry, positiveRe, negativeRe) {
if (this._settings.unique) {
if (this._isDuplicateEntry(entry)) {
return false;
}
this._createIndexRecord(entry);
}
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
return false;
}
if (this._isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) {
return false;
}
const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
return this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
}
_isDuplicateEntry(entry) {
return this.index.has(entry.path);
}
_createIndexRecord(entry) {
this.index.set(entry.path, undefined);
}
_onlyFileFilter(entry) {
return this._settings.onlyFiles && !entry.dirent.isFile();
}
_onlyDirectoryFilter(entry) {
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
}
_isSkippedByAbsoluteNegativePatterns(entry, negativeRe) {
if (!this._settings.absolute) {
return false;
}
const fullpath = utils.path.makeAbsolute(this._settings.cwd, entry.path);
return this._isMatchToPatterns(fullpath, negativeRe);
}
_isMatchToPatterns(filepath, patternsRe) {
return utils.pattern.matchAny(filepath, patternsRe);
}
}
exports.default = EntryFilter;

View File

@@ -0,0 +1,8 @@
import Settings from '../../settings';
import { ErrorFilterFunction } from '../../types';
export default class ErrorFilter {
private readonly _settings;
constructor(_settings: Settings);
getFilter(): ErrorFilterFunction;
private _isNonFatalError;
}

15
node_modules/fast-glob/out/providers/filters/error.js generated vendored Normal file
View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("../../utils");
class ErrorFilter {
constructor(_settings) {
this._settings = _settings;
}
getFilter() {
return (error) => this._isNonFatalError(error);
}
_isNonFatalError(error) {
return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
}
}
exports.default = ErrorFilter;

19
node_modules/fast-glob/out/providers/provider.d.ts generated vendored Normal file
View File

@@ -0,0 +1,19 @@
import { Task } from '../managers/tasks';
import Settings from '../settings';
import { MicromatchOptions, ReaderOptions } from '../types';
import DeepFilter from './filters/deep';
import EntryFilter from './filters/entry';
import ErrorFilter from './filters/error';
import EntryTransformer from './transformers/entry';
export default abstract class Provider<T> {
protected readonly _settings: Settings;
readonly errorFilter: ErrorFilter;
readonly entryFilter: EntryFilter;
readonly deepFilter: DeepFilter;
readonly entryTransformer: EntryTransformer;
constructor(_settings: Settings);
abstract read(_task: Task): T;
protected _getRootDirectory(task: Task): string;
protected _getReaderOptions(task: Task): ReaderOptions;
protected _getMicromatchOptions(): MicromatchOptions;
}

48
node_modules/fast-glob/out/providers/provider.js generated vendored Normal file
View File

@@ -0,0 +1,48 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const deep_1 = require("./filters/deep");
const entry_1 = require("./filters/entry");
const error_1 = require("./filters/error");
const entry_2 = require("./transformers/entry");
class Provider {
constructor(_settings) {
this._settings = _settings;
this.errorFilter = new error_1.default(this._settings);
this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
this.entryTransformer = new entry_2.default(this._settings);
}
_getRootDirectory(task) {
return path.resolve(this._settings.cwd, task.base);
}
_getReaderOptions(task) {
const basePath = task.base === '.' ? '' : task.base;
return {
basePath,
pathSegmentSeparator: '/',
concurrency: this._settings.concurrency,
deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
errorFilter: this.errorFilter.getFilter(),
followSymbolicLinks: this._settings.followSymbolicLinks,
fs: this._settings.fs,
stats: this._settings.stats,
throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
transform: this.entryTransformer.getTransformer()
};
}
_getMicromatchOptions() {
return {
dot: this._settings.dot,
matchBase: this._settings.baseNameMatch,
nobrace: !this._settings.braceExpansion,
nocase: !this._settings.caseSensitiveMatch,
noext: !this._settings.extglob,
noglobstar: !this._settings.globstar,
posix: true,
strictSlashes: false
};
}
}
exports.default = Provider;

10
node_modules/fast-glob/out/providers/stream.d.ts generated vendored Normal file
View File

@@ -0,0 +1,10 @@
/// <reference types="node" />
import { Task } from '../managers/tasks';
import ReaderStream from '../readers/stream';
import { ReaderOptions } from '../types';
import Provider from './provider';
export default class ProviderStream extends Provider<NodeJS.ReadableStream> {
protected _reader: ReaderStream;
read(task: Task): NodeJS.ReadableStream;
api(root: string, task: Task, options: ReaderOptions): NodeJS.ReadableStream;
}

29
node_modules/fast-glob/out/providers/stream.js generated vendored Normal file
View File

@@ -0,0 +1,29 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = require("stream");
const stream_2 = require("../readers/stream");
const provider_1 = require("./provider");
class ProviderStream extends provider_1.default {
constructor() {
super(...arguments);
this._reader = new stream_2.default(this._settings);
}
read(task) {
const root = this._getRootDirectory(task);
const options = this._getReaderOptions(task);
const source = this.api(root, task, options);
const destination = new stream_1.Readable({ objectMode: true, read: () => { } });
source
.once('error', (error) => destination.emit('error', error))
.on('data', (entry) => destination.emit('data', options.transform(entry)))
.once('end', () => destination.emit('end'));
return destination;
}
api(root, task, options) {
if (task.dynamic) {
return this._reader.dynamic(root, options);
}
return this._reader.static(task.patterns, options);
}
}
exports.default = ProviderStream;

9
node_modules/fast-glob/out/providers/sync.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
import { Task } from '../managers/tasks';
import ReaderSync from '../readers/sync';
import { Entry, EntryItem, ReaderOptions } from '../types';
import Provider from './provider';
export default class ProviderSync extends Provider<EntryItem[]> {
protected _reader: ReaderSync;
read(task: Task): EntryItem[];
api(root: string, task: Task, options: ReaderOptions): Entry[];
}

23
node_modules/fast-glob/out/providers/sync.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sync_1 = require("../readers/sync");
const provider_1 = require("./provider");
class ProviderSync extends provider_1.default {
constructor() {
super(...arguments);
this._reader = new sync_1.default(this._settings);
}
read(task) {
const root = this._getRootDirectory(task);
const options = this._getReaderOptions(task);
const entries = this.api(root, task, options);
return entries.map(options.transform);
}
api(root, task, options) {
if (task.dynamic) {
return this._reader.dynamic(root, options);
}
return this._reader.static(task.patterns, options);
}
}
exports.default = ProviderSync;

View File

@@ -0,0 +1,8 @@
import Settings from '../../settings';
import { EntryTransformerFunction } from '../../types';
export default class EntryTransformer {
private readonly _settings;
constructor(_settings: Settings);
getTransformer(): EntryTransformerFunction;
private _transform;
}

View File

@@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("../../utils");
class EntryTransformer {
constructor(_settings) {
this._settings = _settings;
}
getTransformer() {
return (entry) => this._transform(entry);
}
_transform(entry) {
let filepath = entry.path;
if (this._settings.absolute) {
filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
filepath = utils.path.unixify(filepath);
}
if (this._settings.markDirectories && entry.dirent.isDirectory()) {
filepath += '/';
}
if (!this._settings.objectMode) {
return filepath;
}
return Object.assign(Object.assign({}, entry), { path: filepath });
}
}
exports.default = EntryTransformer;

15
node_modules/fast-glob/out/readers/reader.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
/// <reference types="node" />
import * as fs from 'fs';
import * as fsStat from '@nodelib/fs.stat';
import Settings from '../settings';
import { Entry, ErrnoException, Pattern, ReaderOptions } from '../types';
export default abstract class Reader<T> {
protected readonly _settings: Settings;
protected readonly _fsStatSettings: fsStat.Settings;
constructor(_settings: Settings);
abstract dynamic(root: string, options: ReaderOptions): T;
abstract static(patterns: Pattern[], options: ReaderOptions): T;
protected _getFullEntryPath(filepath: string): string;
protected _makeEntry(stats: fs.Stats, pattern: Pattern): Entry;
protected _isFatalError(error: ErrnoException): boolean;
}

33
node_modules/fast-glob/out/readers/reader.js generated vendored Normal file
View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const fsStat = require("@nodelib/fs.stat");
const utils = require("../utils");
class Reader {
constructor(_settings) {
this._settings = _settings;
this._fsStatSettings = new fsStat.Settings({
followSymbolicLink: this._settings.followSymbolicLinks,
fs: this._settings.fs,
throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
});
}
_getFullEntryPath(filepath) {
return path.resolve(this._settings.cwd, filepath);
}
_makeEntry(stats, pattern) {
const entry = {
name: pattern,
path: pattern,
dirent: utils.fs.createDirentFromStats(pattern, stats)
};
if (this._settings.stats) {
entry.stats = stats;
}
return entry;
}
_isFatalError(error) {
return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
}
}
exports.default = Reader;

13
node_modules/fast-glob/out/readers/stream.d.ts generated vendored Normal file
View File

@@ -0,0 +1,13 @@
/// <reference types="node" />
import * as fsStat from '@nodelib/fs.stat';
import * as fsWalk from '@nodelib/fs.walk';
import { Pattern, ReaderOptions } from '../types';
import Reader from './reader';
export default class ReaderStream extends Reader<NodeJS.ReadableStream> {
protected _walkStream: typeof fsWalk.walkStream;
protected _stat: typeof fsStat.stat;
dynamic(root: string, options: ReaderOptions): NodeJS.ReadableStream;
static(patterns: Pattern[], options: ReaderOptions): NodeJS.ReadableStream;
private _getEntry;
private _getStat;
}

55
node_modules/fast-glob/out/readers/stream.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const stream_1 = require("stream");
const fsStat = require("@nodelib/fs.stat");
const fsWalk = require("@nodelib/fs.walk");
const reader_1 = require("./reader");
class ReaderStream extends reader_1.default {
constructor() {
super(...arguments);
this._walkStream = fsWalk.walkStream;
this._stat = fsStat.stat;
}
dynamic(root, options) {
return this._walkStream(root, options);
}
static(patterns, options) {
const filepaths = patterns.map(this._getFullEntryPath, this);
const stream = new stream_1.PassThrough({ objectMode: true });
stream._write = (index, _enc, done) => {
return this._getEntry(filepaths[index], patterns[index], options)
.then((entry) => {
if (entry !== null && options.entryFilter(entry)) {
stream.push(entry);
}
if (index === filepaths.length - 1) {
stream.end();
}
done();
})
.catch(done);
};
for (let i = 0; i < filepaths.length; i++) {
stream.write(i);
}
return stream;
}
_getEntry(filepath, pattern, options) {
return this._getStat(filepath)
.then((stats) => this._makeEntry(stats, pattern))
.catch((error) => {
if (options.errorFilter(error)) {
return null;
}
throw error;
});
}
_getStat(filepath) {
return new Promise((resolve, reject) => {
this._stat(filepath, this._fsStatSettings, (error, stats) => {
return error === null ? resolve(stats) : reject(error);
});
});
}
}
exports.default = ReaderStream;

12
node_modules/fast-glob/out/readers/sync.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import * as fsStat from '@nodelib/fs.stat';
import * as fsWalk from '@nodelib/fs.walk';
import { Entry, Pattern, ReaderOptions } from '../types';
import Reader from './reader';
export default class ReaderSync extends Reader<Entry[]> {
protected _walkSync: typeof fsWalk.walkSync;
protected _statSync: typeof fsStat.statSync;
dynamic(root: string, options: ReaderOptions): Entry[];
static(patterns: Pattern[], options: ReaderOptions): Entry[];
private _getEntry;
private _getStat;
}

43
node_modules/fast-glob/out/readers/sync.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fsStat = require("@nodelib/fs.stat");
const fsWalk = require("@nodelib/fs.walk");
const reader_1 = require("./reader");
class ReaderSync extends reader_1.default {
constructor() {
super(...arguments);
this._walkSync = fsWalk.walkSync;
this._statSync = fsStat.statSync;
}
dynamic(root, options) {
return this._walkSync(root, options);
}
static(patterns, options) {
const entries = [];
for (const pattern of patterns) {
const filepath = this._getFullEntryPath(pattern);
const entry = this._getEntry(filepath, pattern, options);
if (entry === null || !options.entryFilter(entry)) {
continue;
}
entries.push(entry);
}
return entries;
}
_getEntry(filepath, pattern, options) {
try {
const stats = this._getStat(filepath);
return this._makeEntry(stats, pattern);
}
catch (error) {
if (options.errorFilter(error)) {
return null;
}
throw error;
}
}
_getStat(filepath) {
return this._statSync(filepath, this._fsStatSettings);
}
}
exports.default = ReaderSync;

164
node_modules/fast-glob/out/settings.d.ts generated vendored Normal file
View File

@@ -0,0 +1,164 @@
import { FileSystemAdapter, Pattern } from './types';
export declare const DEFAULT_FILE_SYSTEM_ADAPTER: FileSystemAdapter;
export declare type Options = {
/**
* Return the absolute path for entries.
*
* @default false
*/
absolute?: boolean;
/**
* If set to `true`, then patterns without slashes will be matched against
* the basename of the path if it contains slashes.
*
* @default false
*/
baseNameMatch?: boolean;
/**
* Enables Bash-like brace expansion.
*
* @default true
*/
braceExpansion?: boolean;
/**
* Enables a case-sensitive mode for matching files.
*
* @default true
*/
caseSensitiveMatch?: boolean;
/**
* Specifies the maximum number of concurrent requests from a reader to read
* directories.
*
* @default os.cpus().length
*/
concurrency?: number;
/**
* The current working directory in which to search.
*
* @default process.cwd()
*/
cwd?: string;
/**
* Specifies the maximum depth of a read directory relative to the start
* directory.
*
* @default Infinity
*/
deep?: number;
/**
* Allow patterns to match entries that begin with a period (`.`).
*
* @default false
*/
dot?: boolean;
/**
* Enables Bash-like `extglob` functionality.
*
* @default true
*/
extglob?: boolean;
/**
* Indicates whether to traverse descendants of symbolic link directories.
*
* @default true
*/
followSymbolicLinks?: boolean;
/**
* Custom implementation of methods for working with the file system.
*
* @default fs.*
*/
fs?: Partial<FileSystemAdapter>;
/**
* Enables recursively repeats a pattern containing `**`.
* If `false`, `**` behaves exactly like `*`.
*
* @default true
*/
globstar?: boolean;
/**
* An array of glob patterns to exclude matches.
* This is an alternative way to use negative patterns.
*
* @default []
*/
ignore?: Pattern[];
/**
* Mark the directory path with the final slash.
*
* @default false
*/
markDirectories?: boolean;
/**
* Returns objects (instead of strings) describing entries.
*
* @default false
*/
objectMode?: boolean;
/**
* Return only directories.
*
* @default false
*/
onlyDirectories?: boolean;
/**
* Return only files.
*
* @default true
*/
onlyFiles?: boolean;
/**
* Enables an object mode (`objectMode`) with an additional `stats` field.
*
* @default false
*/
stats?: boolean;
/**
* By default this package suppress only `ENOENT` errors.
* Set to `true` to suppress any error.
*
* @default false
*/
suppressErrors?: boolean;
/**
* Throw an error when symbolic link is broken if `true` or safely
* return `lstat` call if `false`.
*
* @default false
*/
throwErrorOnBrokenSymbolicLink?: boolean;
/**
* Ensures that the returned entries are unique.
*
* @default true
*/
unique?: boolean;
};
export default class Settings {
private readonly _options;
readonly absolute: boolean;
readonly baseNameMatch: boolean;
readonly braceExpansion: boolean;
readonly caseSensitiveMatch: boolean;
readonly concurrency: number;
readonly cwd: string;
readonly deep: number;
readonly dot: boolean;
readonly extglob: boolean;
readonly followSymbolicLinks: boolean;
readonly fs: FileSystemAdapter;
readonly globstar: boolean;
readonly ignore: Pattern[];
readonly markDirectories: boolean;
readonly objectMode: boolean;
readonly onlyDirectories: boolean;
readonly onlyFiles: boolean;
readonly stats: boolean;
readonly suppressErrors: boolean;
readonly throwErrorOnBrokenSymbolicLink: boolean;
readonly unique: boolean;
constructor(_options?: Options);
private _getValue;
private _getFileSystemMethods;
}

52
node_modules/fast-glob/out/settings.js generated vendored Normal file
View File

@@ -0,0 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const os = require("os");
const CPU_COUNT = os.cpus().length;
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
lstat: fs.lstat,
lstatSync: fs.lstatSync,
stat: fs.stat,
statSync: fs.statSync,
readdir: fs.readdir,
readdirSync: fs.readdirSync
};
class Settings {
constructor(_options = {}) {
this._options = _options;
this.absolute = this._getValue(this._options.absolute, false);
this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
this.braceExpansion = this._getValue(this._options.braceExpansion, true);
this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
this.cwd = this._getValue(this._options.cwd, process.cwd());
this.deep = this._getValue(this._options.deep, Infinity);
this.dot = this._getValue(this._options.dot, false);
this.extglob = this._getValue(this._options.extglob, true);
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
this.fs = this._getFileSystemMethods(this._options.fs);
this.globstar = this._getValue(this._options.globstar, true);
this.ignore = this._getValue(this._options.ignore, []);
this.markDirectories = this._getValue(this._options.markDirectories, false);
this.objectMode = this._getValue(this._options.objectMode, false);
this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
this.onlyFiles = this._getValue(this._options.onlyFiles, true);
this.stats = this._getValue(this._options.stats, false);
this.suppressErrors = this._getValue(this._options.suppressErrors, false);
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
this.unique = this._getValue(this._options.unique, true);
if (this.onlyDirectories) {
this.onlyFiles = false;
}
if (this.stats) {
this.objectMode = true;
}
}
_getValue(option, value) {
return option === undefined ? value : option;
}
_getFileSystemMethods(methods = {}) {
return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
}
}
exports.default = Settings;

31
node_modules/fast-glob/out/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,31 @@
/// <reference types="node" />
import * as fsWalk from '@nodelib/fs.walk';
export declare type ErrnoException = NodeJS.ErrnoException;
export declare type Entry = fsWalk.Entry;
export declare type EntryItem = string | Entry;
export declare type Pattern = string;
export declare type PatternRe = RegExp;
export declare type PatternsGroup = Record<string, Pattern[]>;
export declare type ReaderOptions = fsWalk.Options & {
transform(entry: Entry): EntryItem;
deepFilter: DeepFilterFunction;
entryFilter: EntryFilterFunction;
errorFilter: ErrorFilterFunction;
fs: FileSystemAdapter;
stats: boolean;
};
export declare type ErrorFilterFunction = fsWalk.ErrorFilterFunction;
export declare type EntryFilterFunction = fsWalk.EntryFilterFunction;
export declare type DeepFilterFunction = fsWalk.DeepFilterFunction;
export declare type EntryTransformerFunction = (entry: Entry) => EntryItem;
export declare type MicromatchOptions = {
dot?: boolean;
matchBase?: boolean;
nobrace?: boolean;
nocase?: boolean;
noext?: boolean;
noglobstar?: boolean;
posix?: boolean;
strictSlashes?: boolean;
};
export declare type FileSystemAdapter = fsWalk.FileSystemAdapter;

2
node_modules/fast-glob/out/types/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

1
node_modules/fast-glob/out/utils/array.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export declare function flatten<T>(items: T[][]): T[];

6
node_modules/fast-glob/out/utils/array.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function flatten(items) {
return items.reduce((collection, item) => [].concat(collection, item), []);
}
exports.flatten = flatten;

2
node_modules/fast-glob/out/utils/errno.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
import { ErrnoException } from '../types';
export declare function isEnoentCodeError(error: ErrnoException): boolean;

6
node_modules/fast-glob/out/utils/errno.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function isEnoentCodeError(error) {
return error.code === 'ENOENT';
}
exports.isEnoentCodeError = isEnoentCodeError;

4
node_modules/fast-glob/out/utils/fs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
/// <reference types="node" />
import * as fs from 'fs';
import { Dirent } from '@nodelib/fs.walk';
export declare function createDirentFromStats(name: string, stats: fs.Stats): Dirent;

18
node_modules/fast-glob/out/utils/fs.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class DirentFromStats {
constructor(name, stats) {
this.name = name;
this.isBlockDevice = stats.isBlockDevice.bind(stats);
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
this.isDirectory = stats.isDirectory.bind(stats);
this.isFIFO = stats.isFIFO.bind(stats);
this.isFile = stats.isFile.bind(stats);
this.isSocket = stats.isSocket.bind(stats);
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
}
}
function createDirentFromStats(name, stats) {
return new DirentFromStats(name, stats);
}
exports.createDirentFromStats = createDirentFromStats;

7
node_modules/fast-glob/out/utils/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import * as array from './array';
import * as errno from './errno';
import * as fs from './fs';
import * as path from './path';
import * as pattern from './pattern';
import * as stream from './stream';
export { array, errno, fs, path, pattern, stream };

14
node_modules/fast-glob/out/utils/index.js generated vendored Normal file
View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const array = require("./array");
exports.array = array;
const errno = require("./errno");
exports.errno = errno;
const fs = require("./fs");
exports.fs = fs;
const path = require("./path");
exports.path = path;
const pattern = require("./pattern");
exports.pattern = pattern;
const stream = require("./stream");
exports.stream = stream;

7
node_modules/fast-glob/out/utils/path.d.ts generated vendored Normal file
View File

@@ -0,0 +1,7 @@
import { Pattern } from '../types';
/**
* Designed to work only with simple paths: `dir\\file`.
*/
export declare function unixify(filepath: string): string;
export declare function makeAbsolute(cwd: string, filepath: string): string;
export declare function escape(pattern: Pattern): Pattern;

19
node_modules/fast-glob/out/utils/path.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([*?|(){}[\]]|^!|[@+!](?=\())/g;
/**
* Designed to work only with simple paths: `dir\\file`.
*/
function unixify(filepath) {
return filepath.replace(/\\/g, '/');
}
exports.unixify = unixify;
function makeAbsolute(cwd, filepath) {
return path.resolve(cwd, filepath);
}
exports.makeAbsolute = makeAbsolute;
function escape(pattern) {
return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
}
exports.escape = escape;

24
node_modules/fast-glob/out/utils/pattern.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import { MicromatchOptions, Pattern, PatternRe } from '../types';
declare type PatternTypeOptions = {
braceExpansion?: boolean;
caseSensitiveMatch?: boolean;
extglob?: boolean;
};
export declare function isStaticPattern(pattern: Pattern, options?: PatternTypeOptions): boolean;
export declare function isDynamicPattern(pattern: Pattern, options?: PatternTypeOptions): boolean;
export declare function convertToPositivePattern(pattern: Pattern): Pattern;
export declare function convertToNegativePattern(pattern: Pattern): Pattern;
export declare function isNegativePattern(pattern: Pattern): boolean;
export declare function isPositivePattern(pattern: Pattern): boolean;
export declare function getNegativePatterns(patterns: Pattern[]): Pattern[];
export declare function getPositivePatterns(patterns: Pattern[]): Pattern[];
export declare function getBaseDirectory(pattern: Pattern): string;
export declare function hasGlobStar(pattern: Pattern): boolean;
export declare function endsWithSlashGlobStar(pattern: Pattern): boolean;
export declare function isAffectDepthOfReadingPattern(pattern: Pattern): boolean;
export declare function getNaiveDepth(pattern: Pattern): number;
export declare function getMaxNaivePatternsDepth(patterns: Pattern[]): number;
export declare function makeRe(pattern: Pattern, options: MicromatchOptions): PatternRe;
export declare function convertPatternsToRe(patterns: Pattern[], options: MicromatchOptions): PatternRe[];
export declare function matchAny(entry: string, patternsRe: PatternRe[]): boolean;
export {};

112
node_modules/fast-glob/out/utils/pattern.js generated vendored Normal file
View File

@@ -0,0 +1,112 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const globParent = require("glob-parent");
const micromatch = require("micromatch");
const GLOBSTAR = '**';
const ESCAPE_SYMBOL = '\\';
const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/;
const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^@!*?+])\(.*\|.*\)/;
const GLOB_EXTENSION_SYMBOLS_RE = /[@!*?+]\(.*\)/;
const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/;
function isStaticPattern(pattern, options = {}) {
return !isDynamicPattern(pattern, options);
}
exports.isStaticPattern = isStaticPattern;
function isDynamicPattern(pattern, options = {}) {
/**
* When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
* filepath directly (without read directory).
*/
if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
return true;
}
if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
return true;
}
if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
return true;
}
if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) {
return true;
}
return false;
}
exports.isDynamicPattern = isDynamicPattern;
function convertToPositivePattern(pattern) {
return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
}
exports.convertToPositivePattern = convertToPositivePattern;
function convertToNegativePattern(pattern) {
return '!' + pattern;
}
exports.convertToNegativePattern = convertToNegativePattern;
function isNegativePattern(pattern) {
return pattern.startsWith('!') && pattern[1] !== '(';
}
exports.isNegativePattern = isNegativePattern;
function isPositivePattern(pattern) {
return !isNegativePattern(pattern);
}
exports.isPositivePattern = isPositivePattern;
function getNegativePatterns(patterns) {
return patterns.filter(isNegativePattern);
}
exports.getNegativePatterns = getNegativePatterns;
function getPositivePatterns(patterns) {
return patterns.filter(isPositivePattern);
}
exports.getPositivePatterns = getPositivePatterns;
function getBaseDirectory(pattern) {
return globParent(pattern, { flipBackslashes: false });
}
exports.getBaseDirectory = getBaseDirectory;
function hasGlobStar(pattern) {
return pattern.includes(GLOBSTAR);
}
exports.hasGlobStar = hasGlobStar;
function endsWithSlashGlobStar(pattern) {
return pattern.endsWith('/' + GLOBSTAR);
}
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
function isAffectDepthOfReadingPattern(pattern) {
const basename = path.basename(pattern);
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
}
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
function getNaiveDepth(pattern) {
const base = getBaseDirectory(pattern);
const patternDepth = pattern.split('/').length;
const patternBaseDepth = base.split('/').length;
/**
* This is a hack for pattern that has no base directory.
*
* This is related to the `*\something\*` pattern.
*/
if (base === '.') {
return patternDepth - patternBaseDepth;
}
return patternDepth - patternBaseDepth - 1;
}
exports.getNaiveDepth = getNaiveDepth;
function getMaxNaivePatternsDepth(patterns) {
return patterns.reduce((max, pattern) => {
const depth = getNaiveDepth(pattern);
return depth > max ? depth : max;
}, 0);
}
exports.getMaxNaivePatternsDepth = getMaxNaivePatternsDepth;
function makeRe(pattern, options) {
return micromatch.makeRe(pattern, options);
}
exports.makeRe = makeRe;
function convertPatternsToRe(patterns, options) {
return patterns.map((pattern) => makeRe(pattern, options));
}
exports.convertPatternsToRe = convertPatternsToRe;
function matchAny(entry, patternsRe) {
const filepath = entry.replace(/^\.[\\/]/, '');
return patternsRe.some((patternRe) => patternRe.test(filepath));
}
exports.matchAny = matchAny;

2
node_modules/fast-glob/out/utils/stream.d.ts generated vendored Normal file
View File

@@ -0,0 +1,2 @@
/// <reference types="node" />
export declare function merge(streams: NodeJS.ReadableStream[]): NodeJS.ReadableStream;

11
node_modules/fast-glob/out/utils/stream.js generated vendored Normal file
View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const merge2 = require("merge2");
function merge(streams) {
const mergedStream = merge2(streams);
streams.forEach((stream) => {
stream.once('error', (error) => mergedStream.emit('error', error));
});
return mergedStream;
}
exports.merge = merge;