format: prettify entire project
This commit is contained in:
6
node_modules/fast-glob/out/providers/async.d.ts
generated
vendored
6
node_modules/fast-glob/out/providers/async.d.ts
generated
vendored
@ -3,7 +3,7 @@ import { Entry, EntryItem, ReaderOptions } from '../types';
|
||||
import ReaderAsync from '../readers/async';
|
||||
import Provider from './provider';
|
||||
export default class ProviderAsync extends Provider<Promise<EntryItem[]>> {
|
||||
protected _reader: ReaderAsync;
|
||||
read(task: Task): Promise<EntryItem[]>;
|
||||
api(root: string, task: Task, options: ReaderOptions): Promise<Entry[]>;
|
||||
protected _reader: ReaderAsync;
|
||||
read(task: Task): Promise<EntryItem[]>;
|
||||
api(root: string, task: Task, options: ReaderOptions): Promise<Entry[]>;
|
||||
}
|
||||
|
38
node_modules/fast-glob/out/providers/async.js
generated
vendored
38
node_modules/fast-glob/out/providers/async.js
generated
vendored
@ -1,23 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const async_1 = require("../readers/async");
|
||||
const provider_1 = require("./provider");
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
const async_1 = require('../readers/async');
|
||||
const provider_1 = require('./provider');
|
||||
class ProviderAsync extends provider_1.default {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._reader = new async_1.default(this._settings);
|
||||
}
|
||||
async read(task) {
|
||||
const root = this._getRootDirectory(task);
|
||||
const options = this._getReaderOptions(task);
|
||||
const entries = await this.api(root, task, options);
|
||||
return entries.map((entry) => options.transform(entry));
|
||||
}
|
||||
api(root, task, options) {
|
||||
if (task.dynamic) {
|
||||
return this._reader.dynamic(root, options);
|
||||
}
|
||||
return this._reader.static(task.patterns, options);
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._reader = new async_1.default(this._settings);
|
||||
}
|
||||
async read(task) {
|
||||
const root = this._getRootDirectory(task);
|
||||
const options = this._getReaderOptions(task);
|
||||
const entries = await this.api(root, task, options);
|
||||
return entries.map((entry) => options.transform(entry));
|
||||
}
|
||||
api(root, task, options) {
|
||||
if (task.dynamic) {
|
||||
return this._reader.dynamic(root, options);
|
||||
}
|
||||
return this._reader.static(task.patterns, options);
|
||||
}
|
||||
}
|
||||
exports.default = ProviderAsync;
|
||||
|
28
node_modules/fast-glob/out/providers/filters/deep.d.ts
generated
vendored
28
node_modules/fast-glob/out/providers/filters/deep.d.ts
generated
vendored
@ -1,16 +1,20 @@
|
||||
import { MicromatchOptions, EntryFilterFunction, Pattern } from '../../types';
|
||||
import Settings from '../../settings';
|
||||
export default class DeepFilter {
|
||||
private readonly _settings;
|
||||
private readonly _micromatchOptions;
|
||||
constructor(_settings: Settings, _micromatchOptions: MicromatchOptions);
|
||||
getFilter(basePath: string, positive: Pattern[], negative: Pattern[]): EntryFilterFunction;
|
||||
private _getMatcher;
|
||||
private _getNegativePatternsRe;
|
||||
private _filter;
|
||||
private _isSkippedByDeep;
|
||||
private _getEntryLevel;
|
||||
private _isSkippedSymbolicLink;
|
||||
private _isSkippedByPositivePatterns;
|
||||
private _isSkippedByNegativePatterns;
|
||||
private readonly _settings;
|
||||
private readonly _micromatchOptions;
|
||||
constructor(_settings: Settings, _micromatchOptions: MicromatchOptions);
|
||||
getFilter(
|
||||
basePath: string,
|
||||
positive: Pattern[],
|
||||
negative: Pattern[]
|
||||
): EntryFilterFunction;
|
||||
private _getMatcher;
|
||||
private _getNegativePatternsRe;
|
||||
private _filter;
|
||||
private _isSkippedByDeep;
|
||||
private _getEntryLevel;
|
||||
private _isSkippedSymbolicLink;
|
||||
private _isSkippedByPositivePatterns;
|
||||
private _isSkippedByNegativePatterns;
|
||||
}
|
||||
|
117
node_modules/fast-glob/out/providers/filters/deep.js
generated
vendored
117
node_modules/fast-glob/out/providers/filters/deep.js
generated
vendored
@ -1,62 +1,71 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils = require("../../utils");
|
||||
const partial_1 = require("../matchers/partial");
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
const utils = require('../../utils');
|
||||
const partial_1 = require('../matchers/partial');
|
||||
class DeepFilter {
|
||||
constructor(_settings, _micromatchOptions) {
|
||||
this._settings = _settings;
|
||||
this._micromatchOptions = _micromatchOptions;
|
||||
constructor(_settings, _micromatchOptions) {
|
||||
this._settings = _settings;
|
||||
this._micromatchOptions = _micromatchOptions;
|
||||
}
|
||||
getFilter(basePath, positive, negative) {
|
||||
const matcher = this._getMatcher(positive);
|
||||
const negativeRe = this._getNegativePatternsRe(negative);
|
||||
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
||||
}
|
||||
_getMatcher(patterns) {
|
||||
return new partial_1.default(
|
||||
patterns,
|
||||
this._settings,
|
||||
this._micromatchOptions
|
||||
);
|
||||
}
|
||||
_getNegativePatternsRe(patterns) {
|
||||
const affectDepthOfReadingPatterns = patterns.filter(
|
||||
utils.pattern.isAffectDepthOfReadingPattern
|
||||
);
|
||||
return utils.pattern.convertPatternsToRe(
|
||||
affectDepthOfReadingPatterns,
|
||||
this._micromatchOptions
|
||||
);
|
||||
}
|
||||
_filter(basePath, entry, matcher, negativeRe) {
|
||||
if (this._isSkippedByDeep(basePath, entry.path)) {
|
||||
return false;
|
||||
}
|
||||
getFilter(basePath, positive, negative) {
|
||||
const matcher = this._getMatcher(positive);
|
||||
const negativeRe = this._getNegativePatternsRe(negative);
|
||||
return (entry) => this._filter(basePath, entry, matcher, negativeRe);
|
||||
if (this._isSkippedSymbolicLink(entry)) {
|
||||
return false;
|
||||
}
|
||||
_getMatcher(patterns) {
|
||||
return new partial_1.default(patterns, this._settings, this._micromatchOptions);
|
||||
const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
||||
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
||||
return false;
|
||||
}
|
||||
_getNegativePatternsRe(patterns) {
|
||||
const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
|
||||
return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
|
||||
return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
||||
}
|
||||
_isSkippedByDeep(basePath, entryPath) {
|
||||
/**
|
||||
* Avoid unnecessary depth calculations when it doesn't matter.
|
||||
*/
|
||||
if (this._settings.deep === Infinity) {
|
||||
return false;
|
||||
}
|
||||
_filter(basePath, entry, matcher, negativeRe) {
|
||||
if (this._isSkippedByDeep(basePath, entry.path)) {
|
||||
return false;
|
||||
}
|
||||
if (this._isSkippedSymbolicLink(entry)) {
|
||||
return false;
|
||||
}
|
||||
const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
||||
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
|
||||
return false;
|
||||
}
|
||||
return this._isSkippedByNegativePatterns(filepath, negativeRe);
|
||||
}
|
||||
_isSkippedByDeep(basePath, entryPath) {
|
||||
/**
|
||||
* Avoid unnecessary depth calculations when it doesn't matter.
|
||||
*/
|
||||
if (this._settings.deep === Infinity) {
|
||||
return false;
|
||||
}
|
||||
return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
||||
}
|
||||
_getEntryLevel(basePath, entryPath) {
|
||||
const entryPathDepth = entryPath.split('/').length;
|
||||
if (basePath === '') {
|
||||
return entryPathDepth;
|
||||
}
|
||||
const basePathDepth = basePath.split('/').length;
|
||||
return entryPathDepth - basePathDepth;
|
||||
}
|
||||
_isSkippedSymbolicLink(entry) {
|
||||
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
||||
}
|
||||
_isSkippedByPositivePatterns(entryPath, matcher) {
|
||||
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
||||
}
|
||||
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
||||
return !utils.pattern.matchAny(entryPath, patternsRe);
|
||||
return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
|
||||
}
|
||||
_getEntryLevel(basePath, entryPath) {
|
||||
const entryPathDepth = entryPath.split('/').length;
|
||||
if (basePath === '') {
|
||||
return entryPathDepth;
|
||||
}
|
||||
const basePathDepth = basePath.split('/').length;
|
||||
return entryPathDepth - basePathDepth;
|
||||
}
|
||||
_isSkippedSymbolicLink(entry) {
|
||||
return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
|
||||
}
|
||||
_isSkippedByPositivePatterns(entryPath, matcher) {
|
||||
return !this._settings.baseNameMatch && !matcher.match(entryPath);
|
||||
}
|
||||
_isSkippedByNegativePatterns(entryPath, patternsRe) {
|
||||
return !utils.pattern.matchAny(entryPath, patternsRe);
|
||||
}
|
||||
}
|
||||
exports.default = DeepFilter;
|
||||
|
26
node_modules/fast-glob/out/providers/filters/entry.d.ts
generated
vendored
26
node_modules/fast-glob/out/providers/filters/entry.d.ts
generated
vendored
@ -1,17 +1,17 @@
|
||||
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 _isMatchToPatternsSet;
|
||||
private _isMatchToAbsoluteNegative;
|
||||
private _isMatchToPatterns;
|
||||
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 _isMatchToPatternsSet;
|
||||
private _isMatchToAbsoluteNegative;
|
||||
private _isMatchToPatterns;
|
||||
}
|
||||
|
176
node_modules/fast-glob/out/providers/filters/entry.js
generated
vendored
176
node_modules/fast-glob/out/providers/filters/entry.js
generated
vendored
@ -1,85 +1,115 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils = require("../../utils");
|
||||
'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();
|
||||
constructor(_settings, _micromatchOptions) {
|
||||
this._settings = _settings;
|
||||
this._micromatchOptions = _micromatchOptions;
|
||||
this.index = new Map();
|
||||
}
|
||||
getFilter(positive, negative) {
|
||||
const [absoluteNegative, relativeNegative] =
|
||||
utils.pattern.partitionAbsoluteAndRelative(negative);
|
||||
const patterns = {
|
||||
positive: {
|
||||
all: utils.pattern.convertPatternsToRe(
|
||||
positive,
|
||||
this._micromatchOptions
|
||||
),
|
||||
},
|
||||
negative: {
|
||||
absolute: utils.pattern.convertPatternsToRe(
|
||||
absoluteNegative,
|
||||
Object.assign(Object.assign({}, this._micromatchOptions), {
|
||||
dot: true,
|
||||
})
|
||||
),
|
||||
relative: utils.pattern.convertPatternsToRe(
|
||||
relativeNegative,
|
||||
Object.assign(Object.assign({}, this._micromatchOptions), {
|
||||
dot: true,
|
||||
})
|
||||
),
|
||||
},
|
||||
};
|
||||
return (entry) => this._filter(entry, patterns);
|
||||
}
|
||||
_filter(entry, patterns) {
|
||||
const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
||||
if (this._settings.unique && this._isDuplicateEntry(filepath)) {
|
||||
return false;
|
||||
}
|
||||
getFilter(positive, negative) {
|
||||
const [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative);
|
||||
const patterns = {
|
||||
positive: {
|
||||
all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions)
|
||||
},
|
||||
negative: {
|
||||
absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })),
|
||||
relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }))
|
||||
}
|
||||
};
|
||||
return (entry) => this._filter(entry, patterns);
|
||||
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
||||
return false;
|
||||
}
|
||||
_filter(entry, patterns) {
|
||||
const filepath = utils.path.removeLeadingDotSegment(entry.path);
|
||||
if (this._settings.unique && this._isDuplicateEntry(filepath)) {
|
||||
return false;
|
||||
}
|
||||
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
||||
return false;
|
||||
}
|
||||
const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
|
||||
if (this._settings.unique && isMatched) {
|
||||
this._createIndexRecord(filepath);
|
||||
}
|
||||
return isMatched;
|
||||
const isMatched = this._isMatchToPatternsSet(
|
||||
filepath,
|
||||
patterns,
|
||||
entry.dirent.isDirectory()
|
||||
);
|
||||
if (this._settings.unique && isMatched) {
|
||||
this._createIndexRecord(filepath);
|
||||
}
|
||||
_isDuplicateEntry(filepath) {
|
||||
return this.index.has(filepath);
|
||||
return isMatched;
|
||||
}
|
||||
_isDuplicateEntry(filepath) {
|
||||
return this.index.has(filepath);
|
||||
}
|
||||
_createIndexRecord(filepath) {
|
||||
this.index.set(filepath, undefined);
|
||||
}
|
||||
_onlyFileFilter(entry) {
|
||||
return this._settings.onlyFiles && !entry.dirent.isFile();
|
||||
}
|
||||
_onlyDirectoryFilter(entry) {
|
||||
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
||||
}
|
||||
_isMatchToPatternsSet(filepath, patterns, isDirectory) {
|
||||
const isMatched = this._isMatchToPatterns(
|
||||
filepath,
|
||||
patterns.positive.all,
|
||||
isDirectory
|
||||
);
|
||||
if (!isMatched) {
|
||||
return false;
|
||||
}
|
||||
_createIndexRecord(filepath) {
|
||||
this.index.set(filepath, undefined);
|
||||
const isMatchedByRelativeNegative = this._isMatchToPatterns(
|
||||
filepath,
|
||||
patterns.negative.relative,
|
||||
isDirectory
|
||||
);
|
||||
if (isMatchedByRelativeNegative) {
|
||||
return false;
|
||||
}
|
||||
_onlyFileFilter(entry) {
|
||||
return this._settings.onlyFiles && !entry.dirent.isFile();
|
||||
const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(
|
||||
filepath,
|
||||
patterns.negative.absolute,
|
||||
isDirectory
|
||||
);
|
||||
if (isMatchedByAbsoluteNegative) {
|
||||
return false;
|
||||
}
|
||||
_onlyDirectoryFilter(entry) {
|
||||
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
||||
return true;
|
||||
}
|
||||
_isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) {
|
||||
if (patternsRe.length === 0) {
|
||||
return false;
|
||||
}
|
||||
_isMatchToPatternsSet(filepath, patterns, isDirectory) {
|
||||
const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory);
|
||||
if (!isMatched) {
|
||||
return false;
|
||||
}
|
||||
const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory);
|
||||
if (isMatchedByRelativeNegative) {
|
||||
return false;
|
||||
}
|
||||
const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory);
|
||||
if (isMatchedByAbsoluteNegative) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath);
|
||||
return this._isMatchToPatterns(fullpath, patternsRe, isDirectory);
|
||||
}
|
||||
_isMatchToPatterns(filepath, patternsRe, isDirectory) {
|
||||
if (patternsRe.length === 0) {
|
||||
return false;
|
||||
}
|
||||
_isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) {
|
||||
if (patternsRe.length === 0) {
|
||||
return false;
|
||||
}
|
||||
const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath);
|
||||
return this._isMatchToPatterns(fullpath, patternsRe, isDirectory);
|
||||
}
|
||||
_isMatchToPatterns(filepath, patternsRe, isDirectory) {
|
||||
if (patternsRe.length === 0) {
|
||||
return false;
|
||||
}
|
||||
// Trying to match files and directories by patterns.
|
||||
const isMatched = utils.pattern.matchAny(filepath, patternsRe);
|
||||
// A pattern with a trailling slash can be used for directory matching.
|
||||
// To apply such pattern, we need to add a tralling slash to the path.
|
||||
if (!isMatched && isDirectory) {
|
||||
return utils.pattern.matchAny(filepath + '/', patternsRe);
|
||||
}
|
||||
return isMatched;
|
||||
// Trying to match files and directories by patterns.
|
||||
const isMatched = utils.pattern.matchAny(filepath, patternsRe);
|
||||
// A pattern with a trailling slash can be used for directory matching.
|
||||
// To apply such pattern, we need to add a tralling slash to the path.
|
||||
if (!isMatched && isDirectory) {
|
||||
return utils.pattern.matchAny(filepath + '/', patternsRe);
|
||||
}
|
||||
return isMatched;
|
||||
}
|
||||
}
|
||||
exports.default = EntryFilter;
|
||||
|
8
node_modules/fast-glob/out/providers/filters/error.d.ts
generated
vendored
8
node_modules/fast-glob/out/providers/filters/error.d.ts
generated
vendored
@ -1,8 +1,8 @@
|
||||
import Settings from '../../settings';
|
||||
import { ErrorFilterFunction } from '../../types';
|
||||
export default class ErrorFilter {
|
||||
private readonly _settings;
|
||||
constructor(_settings: Settings);
|
||||
getFilter(): ErrorFilterFunction;
|
||||
private _isNonFatalError;
|
||||
private readonly _settings;
|
||||
constructor(_settings: Settings);
|
||||
getFilter(): ErrorFilterFunction;
|
||||
private _isNonFatalError;
|
||||
}
|
||||
|
26
node_modules/fast-glob/out/providers/filters/error.js
generated
vendored
26
node_modules/fast-glob/out/providers/filters/error.js
generated
vendored
@ -1,15 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils = require("../../utils");
|
||||
'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;
|
||||
}
|
||||
constructor(_settings) {
|
||||
this._settings = _settings;
|
||||
}
|
||||
getFilter() {
|
||||
return (error) => this._isNonFatalError(error);
|
||||
}
|
||||
_isNonFatalError(error) {
|
||||
return (
|
||||
utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors
|
||||
);
|
||||
}
|
||||
}
|
||||
exports.default = ErrorFilter;
|
||||
|
44
node_modules/fast-glob/out/providers/matchers/matcher.d.ts
generated
vendored
44
node_modules/fast-glob/out/providers/matchers/matcher.d.ts
generated
vendored
@ -2,32 +2,36 @@ import { Pattern, MicromatchOptions, PatternRe } from '../../types';
|
||||
import Settings from '../../settings';
|
||||
export type PatternSegment = StaticPatternSegment | DynamicPatternSegment;
|
||||
type StaticPatternSegment = {
|
||||
dynamic: false;
|
||||
pattern: Pattern;
|
||||
dynamic: false;
|
||||
pattern: Pattern;
|
||||
};
|
||||
type DynamicPatternSegment = {
|
||||
dynamic: true;
|
||||
pattern: Pattern;
|
||||
patternRe: PatternRe;
|
||||
dynamic: true;
|
||||
pattern: Pattern;
|
||||
patternRe: PatternRe;
|
||||
};
|
||||
export type PatternSection = PatternSegment[];
|
||||
export type PatternInfo = {
|
||||
/**
|
||||
* Indicates that the pattern has a globstar (more than a single section).
|
||||
*/
|
||||
complete: boolean;
|
||||
pattern: Pattern;
|
||||
segments: PatternSegment[];
|
||||
sections: PatternSection[];
|
||||
/**
|
||||
* Indicates that the pattern has a globstar (more than a single section).
|
||||
*/
|
||||
complete: boolean;
|
||||
pattern: Pattern;
|
||||
segments: PatternSegment[];
|
||||
sections: PatternSection[];
|
||||
};
|
||||
export default abstract class Matcher {
|
||||
private readonly _patterns;
|
||||
private readonly _settings;
|
||||
private readonly _micromatchOptions;
|
||||
protected readonly _storage: PatternInfo[];
|
||||
constructor(_patterns: Pattern[], _settings: Settings, _micromatchOptions: MicromatchOptions);
|
||||
private _fillStorage;
|
||||
private _getPatternSegments;
|
||||
private _splitSegmentsIntoSections;
|
||||
private readonly _patterns;
|
||||
private readonly _settings;
|
||||
private readonly _micromatchOptions;
|
||||
protected readonly _storage: PatternInfo[];
|
||||
constructor(
|
||||
_patterns: Pattern[],
|
||||
_settings: Settings,
|
||||
_micromatchOptions: MicromatchOptions
|
||||
);
|
||||
private _fillStorage;
|
||||
private _getPatternSegments;
|
||||
private _splitSegmentsIntoSections;
|
||||
}
|
||||
export {};
|
||||
|
88
node_modules/fast-glob/out/providers/matchers/matcher.js
generated
vendored
88
node_modules/fast-glob/out/providers/matchers/matcher.js
generated
vendored
@ -1,45 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils = require("../../utils");
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
const utils = require('../../utils');
|
||||
class Matcher {
|
||||
constructor(_patterns, _settings, _micromatchOptions) {
|
||||
this._patterns = _patterns;
|
||||
this._settings = _settings;
|
||||
this._micromatchOptions = _micromatchOptions;
|
||||
this._storage = [];
|
||||
this._fillStorage();
|
||||
}
|
||||
_fillStorage() {
|
||||
for (const pattern of this._patterns) {
|
||||
const segments = this._getPatternSegments(pattern);
|
||||
const sections = this._splitSegmentsIntoSections(segments);
|
||||
this._storage.push({
|
||||
complete: sections.length <= 1,
|
||||
pattern,
|
||||
segments,
|
||||
sections
|
||||
});
|
||||
}
|
||||
}
|
||||
_getPatternSegments(pattern) {
|
||||
const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
|
||||
return parts.map((part) => {
|
||||
const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
|
||||
if (!dynamic) {
|
||||
return {
|
||||
dynamic: false,
|
||||
pattern: part
|
||||
};
|
||||
}
|
||||
return {
|
||||
dynamic: true,
|
||||
pattern: part,
|
||||
patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
|
||||
};
|
||||
});
|
||||
}
|
||||
_splitSegmentsIntoSections(segments) {
|
||||
return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
|
||||
constructor(_patterns, _settings, _micromatchOptions) {
|
||||
this._patterns = _patterns;
|
||||
this._settings = _settings;
|
||||
this._micromatchOptions = _micromatchOptions;
|
||||
this._storage = [];
|
||||
this._fillStorage();
|
||||
}
|
||||
_fillStorage() {
|
||||
for (const pattern of this._patterns) {
|
||||
const segments = this._getPatternSegments(pattern);
|
||||
const sections = this._splitSegmentsIntoSections(segments);
|
||||
this._storage.push({
|
||||
complete: sections.length <= 1,
|
||||
pattern,
|
||||
segments,
|
||||
sections,
|
||||
});
|
||||
}
|
||||
}
|
||||
_getPatternSegments(pattern) {
|
||||
const parts = utils.pattern.getPatternParts(
|
||||
pattern,
|
||||
this._micromatchOptions
|
||||
);
|
||||
return parts.map((part) => {
|
||||
const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
|
||||
if (!dynamic) {
|
||||
return {
|
||||
dynamic: false,
|
||||
pattern: part,
|
||||
};
|
||||
}
|
||||
return {
|
||||
dynamic: true,
|
||||
pattern: part,
|
||||
patternRe: utils.pattern.makeRe(part, this._micromatchOptions),
|
||||
};
|
||||
});
|
||||
}
|
||||
_splitSegmentsIntoSections(segments) {
|
||||
return utils.array.splitWhen(
|
||||
segments,
|
||||
(segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)
|
||||
);
|
||||
}
|
||||
}
|
||||
exports.default = Matcher;
|
||||
|
2
node_modules/fast-glob/out/providers/matchers/partial.d.ts
generated
vendored
2
node_modules/fast-glob/out/providers/matchers/partial.d.ts
generated
vendored
@ -1,4 +1,4 @@
|
||||
import Matcher from './matcher';
|
||||
export default class PartialMatcher extends Matcher {
|
||||
match(filepath: string): boolean;
|
||||
match(filepath: string): boolean;
|
||||
}
|
||||
|
66
node_modules/fast-glob/out/providers/matchers/partial.js
generated
vendored
66
node_modules/fast-glob/out/providers/matchers/partial.js
generated
vendored
@ -1,38 +1,40 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const matcher_1 = require("./matcher");
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
const matcher_1 = require('./matcher');
|
||||
class PartialMatcher extends matcher_1.default {
|
||||
match(filepath) {
|
||||
const parts = filepath.split('/');
|
||||
const levels = parts.length;
|
||||
const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
|
||||
for (const pattern of patterns) {
|
||||
const section = pattern.sections[0];
|
||||
/**
|
||||
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
||||
* but only if the level has reached the end of the first group.
|
||||
*
|
||||
* fixtures/{a,b}/**
|
||||
* ^ true/false ^ always true
|
||||
*/
|
||||
if (!pattern.complete && levels > section.length) {
|
||||
return true;
|
||||
}
|
||||
const match = parts.every((part, index) => {
|
||||
const segment = pattern.segments[index];
|
||||
if (segment.dynamic && segment.patternRe.test(part)) {
|
||||
return true;
|
||||
}
|
||||
if (!segment.dynamic && segment.pattern === part) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (match) {
|
||||
return true;
|
||||
}
|
||||
match(filepath) {
|
||||
const parts = filepath.split('/');
|
||||
const levels = parts.length;
|
||||
const patterns = this._storage.filter(
|
||||
(info) => !info.complete || info.segments.length > levels
|
||||
);
|
||||
for (const pattern of patterns) {
|
||||
const section = pattern.sections[0];
|
||||
/**
|
||||
* In this case, the pattern has a globstar and we must read all directories unconditionally,
|
||||
* but only if the level has reached the end of the first group.
|
||||
*
|
||||
* fixtures/{a,b}/**
|
||||
* ^ true/false ^ always true
|
||||
*/
|
||||
if (!pattern.complete && levels > section.length) {
|
||||
return true;
|
||||
}
|
||||
const match = parts.every((part, index) => {
|
||||
const segment = pattern.segments[index];
|
||||
if (segment.dynamic && segment.patternRe.test(part)) {
|
||||
return true;
|
||||
}
|
||||
if (!segment.dynamic && segment.pattern === part) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (match) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
exports.default = PartialMatcher;
|
||||
|
20
node_modules/fast-glob/out/providers/provider.d.ts
generated
vendored
20
node_modules/fast-glob/out/providers/provider.d.ts
generated
vendored
@ -6,14 +6,14 @@ 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;
|
||||
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;
|
||||
}
|
||||
|
101
node_modules/fast-glob/out/providers/provider.js
generated
vendored
101
node_modules/fast-glob/out/providers/provider.js
generated
vendored
@ -1,48 +1,59 @@
|
||||
"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");
|
||||
'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
|
||||
};
|
||||
}
|
||||
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;
|
||||
|
6
node_modules/fast-glob/out/providers/stream.d.ts
generated
vendored
6
node_modules/fast-glob/out/providers/stream.d.ts
generated
vendored
@ -5,7 +5,7 @@ import ReaderStream from '../readers/stream';
|
||||
import { ReaderOptions } from '../types';
|
||||
import Provider from './provider';
|
||||
export default class ProviderStream extends Provider<Readable> {
|
||||
protected _reader: ReaderStream;
|
||||
read(task: Task): Readable;
|
||||
api(root: string, task: Task, options: ReaderOptions): Readable;
|
||||
protected _reader: ReaderStream;
|
||||
read(task: Task): Readable;
|
||||
api(root: string, task: Task, options: ReaderOptions): Readable;
|
||||
}
|
||||
|
56
node_modules/fast-glob/out/providers/stream.js
generated
vendored
56
node_modules/fast-glob/out/providers/stream.js
generated
vendored
@ -1,31 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const stream_1 = require("stream");
|
||||
const stream_2 = require("../readers/stream");
|
||||
const provider_1 = require("./provider");
|
||||
'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'));
|
||||
destination
|
||||
.once('close', () => source.destroy());
|
||||
return destination;
|
||||
}
|
||||
api(root, task, options) {
|
||||
if (task.dynamic) {
|
||||
return this._reader.dynamic(root, options);
|
||||
}
|
||||
return this._reader.static(task.patterns, options);
|
||||
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'));
|
||||
destination.once('close', () => source.destroy());
|
||||
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;
|
||||
|
6
node_modules/fast-glob/out/providers/sync.d.ts
generated
vendored
6
node_modules/fast-glob/out/providers/sync.d.ts
generated
vendored
@ -3,7 +3,7 @@ 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[];
|
||||
protected _reader: ReaderSync;
|
||||
read(task: Task): EntryItem[];
|
||||
api(root: string, task: Task, options: ReaderOptions): Entry[];
|
||||
}
|
||||
|
38
node_modules/fast-glob/out/providers/sync.js
generated
vendored
38
node_modules/fast-glob/out/providers/sync.js
generated
vendored
@ -1,23 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const sync_1 = require("../readers/sync");
|
||||
const provider_1 = require("./provider");
|
||||
'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);
|
||||
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;
|
||||
|
8
node_modules/fast-glob/out/providers/transformers/entry.d.ts
generated
vendored
8
node_modules/fast-glob/out/providers/transformers/entry.d.ts
generated
vendored
@ -1,8 +1,8 @@
|
||||
import Settings from '../../settings';
|
||||
import { EntryTransformerFunction } from '../../types';
|
||||
export default class EntryTransformer {
|
||||
private readonly _settings;
|
||||
constructor(_settings: Settings);
|
||||
getTransformer(): EntryTransformerFunction;
|
||||
private _transform;
|
||||
private readonly _settings;
|
||||
constructor(_settings: Settings);
|
||||
getTransformer(): EntryTransformerFunction;
|
||||
private _transform;
|
||||
}
|
||||
|
40
node_modules/fast-glob/out/providers/transformers/entry.js
generated
vendored
40
node_modules/fast-glob/out/providers/transformers/entry.js
generated
vendored
@ -1,26 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils = require("../../utils");
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
const utils = require('../../utils');
|
||||
class EntryTransformer {
|
||||
constructor(_settings) {
|
||||
this._settings = _settings;
|
||||
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);
|
||||
}
|
||||
getTransformer() {
|
||||
return (entry) => this._transform(entry);
|
||||
if (this._settings.markDirectories && entry.dirent.isDirectory()) {
|
||||
filepath += '/';
|
||||
}
|
||||
_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 });
|
||||
if (!this._settings.objectMode) {
|
||||
return filepath;
|
||||
}
|
||||
return Object.assign(Object.assign({}, entry), { path: filepath });
|
||||
}
|
||||
}
|
||||
exports.default = EntryTransformer;
|
||||
|
Reference in New Issue
Block a user