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

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;