aboutsummaryrefslogtreecommitdiff
path: root/node_modules/fast-glob/out/managers
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/fast-glob/out/managers')
-rw-r--r--node_modules/fast-glob/out/managers/options.d.ts94
-rw-r--r--node_modules/fast-glob/out/managers/options.js42
-rw-r--r--node_modules/fast-glob/out/managers/tasks.d.ts37
-rw-r--r--node_modules/fast-glob/out/managers/tasks.js86
4 files changed, 259 insertions, 0 deletions
diff --git a/node_modules/fast-glob/out/managers/options.d.ts b/node_modules/fast-glob/out/managers/options.d.ts
new file mode 100644
index 0000000..b9c6d5c
--- /dev/null
+++ b/node_modules/fast-glob/out/managers/options.d.ts
@@ -0,0 +1,94 @@
+import { EntryItem } from '../types/entries';
+import { Pattern } from '../types/patterns';
+export declare type TransformFunction<T> = (entry: EntryItem) => T;
+export interface IOptions<T = EntryItem> {
+ /**
+ * The current working directory in which to search.
+ */
+ cwd: string;
+ /**
+ * The deep option can be set to true to traverse the entire directory structure,
+ * or it can be set to a number to only traverse that many levels deep.
+ */
+ deep: number | boolean;
+ /**
+ * Add an array of glob patterns to exclude matches.
+ */
+ ignore: Pattern[];
+ /**
+ * Allow patterns to match filenames starting with a period (files & directories),
+ * even if the pattern does not explicitly have a period in that spot.
+ */
+ dot: boolean;
+ /**
+ * Return `fs.Stats` with `path` property instead of file path.
+ */
+ stats: boolean;
+ /**
+ * Return only files.
+ */
+ onlyFiles: boolean;
+ /**
+ * Return only directories.
+ */
+ onlyDirectories: boolean;
+ /**
+ * Follow symlinked directories when expanding `**` patterns.
+ */
+ followSymlinkedDirectories: boolean;
+ /**
+ * Prevent duplicate results.
+ */
+ unique: boolean;
+ /**
+ * Add a `/` character to directory entries.
+ */
+ markDirectories: boolean;
+ /**
+ * Return absolute paths for matched entries.
+ */
+ absolute: boolean;
+ /**
+ * Disable expansion of brace patterns.
+ */
+ nobrace: boolean;
+ /**
+ * Enable expansion of brace patterns.
+ */
+ brace: boolean;
+ /**
+ * Disable matching with globstars (`**`).
+ */
+ noglobstar: boolean;
+ /**
+ * Enable matching with globstars (`**`).
+ */
+ globstar: boolean;
+ /**
+ * Disable extglob support, so that extglobs are regarded as literal characters.
+ */
+ noext: boolean;
+ /**
+ * Enable extglob support, so that extglobs are regarded as literal characters.
+ */
+ extension: boolean;
+ /**
+ * Disable a case-insensitive regex for matching files.
+ */
+ nocase: boolean;
+ /**
+ * Enable a case-insensitive regex for matching files.
+ */
+ case: boolean;
+ /**
+ * Allow glob patterns without slashes to match a file path based on its basename.
+ * For example, `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
+ */
+ matchBase: boolean;
+ /**
+ * Allows you to transform a path or `fs.Stats` object before sending to the array.
+ */
+ transform: TransformFunction<T> | null;
+}
+export declare type IPartialOptions<T = EntryItem> = Partial<IOptions<T>>;
+export declare function prepare(options?: IPartialOptions): IOptions;
diff --git a/node_modules/fast-glob/out/managers/options.js b/node_modules/fast-glob/out/managers/options.js
new file mode 100644
index 0000000..d719562
--- /dev/null
+++ b/node_modules/fast-glob/out/managers/options.js
@@ -0,0 +1,42 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+function prepare(options) {
+ var opts = Object.assign({
+ cwd: process.cwd(),
+ deep: true,
+ ignore: [],
+ dot: false,
+ stats: false,
+ onlyFiles: true,
+ onlyDirectories: false,
+ followSymlinkedDirectories: true,
+ unique: true,
+ markDirectories: false,
+ absolute: false,
+ nobrace: false,
+ brace: true,
+ noglobstar: false,
+ globstar: true,
+ noext: false,
+ extension: true,
+ nocase: false,
+ case: true,
+ matchBase: false,
+ transform: null
+ }, options);
+ if (opts.onlyDirectories) {
+ opts.onlyFiles = false;
+ }
+ opts.brace = !opts.nobrace;
+ opts.globstar = !opts.noglobstar;
+ opts.extension = !opts.noext;
+ opts.case = !opts.nocase;
+ if (options) {
+ opts.brace = ('brace' in options ? options.brace : opts.brace);
+ opts.globstar = ('globstar' in options ? options.globstar : opts.globstar);
+ opts.extension = ('extension' in options ? options.extension : opts.extension);
+ opts.case = ('case' in options ? options.case : opts.case);
+ }
+ return opts;
+}
+exports.prepare = prepare;
diff --git a/node_modules/fast-glob/out/managers/tasks.d.ts b/node_modules/fast-glob/out/managers/tasks.d.ts
new file mode 100644
index 0000000..e2cc1a9
--- /dev/null
+++ b/node_modules/fast-glob/out/managers/tasks.d.ts
@@ -0,0 +1,37 @@
+import { Pattern, PatternsGroup } from '../types/patterns';
+import { IOptions } from './options';
+export interface ITask {
+ base: string;
+ dynamic: boolean;
+ patterns: Pattern[];
+ positive: Pattern[];
+ negative: Pattern[];
+}
+/**
+ * Generate tasks based on parent directory of each pattern.
+ */
+export declare function generate(patterns: Pattern[], options: IOptions): ITask[];
+/**
+ * Convert patterns to tasks based on parent directory of each pattern.
+ */
+export declare function convertPatternsToTasks(positive: Pattern[], negative: Pattern[], dynamic: boolean): ITask[];
+/**
+ * Return only positive patterns.
+ */
+export declare function getPositivePatterns(patterns: Pattern[]): Pattern[];
+/**
+ * Return only negative patterns.
+ */
+export declare function getNegativePatternsAsPositive(patterns: Pattern[], ignore: Pattern[]): Pattern[];
+/**
+ * Group patterns by base directory of each pattern.
+ */
+export declare function groupPatternsByBaseDirectory(patterns: Pattern[]): PatternsGroup;
+/**
+ * Convert group of patterns to tasks.
+ */
+export declare function convertPatternGroupsToTasks(positive: PatternsGroup, negative: Pattern[], dynamic: boolean): ITask[];
+/**
+ * Create a task for positive and negative patterns.
+ */
+export declare function convertPatternGroupToTask(base: string, positive: Pattern[], negative: Pattern[], dynamic: boolean): ITask;
diff --git a/node_modules/fast-glob/out/managers/tasks.js b/node_modules/fast-glob/out/managers/tasks.js
new file mode 100644
index 0000000..1c5192d
--- /dev/null
+++ b/node_modules/fast-glob/out/managers/tasks.js
@@ -0,0 +1,86 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var patternUtils = require("../utils/pattern");
+/**
+ * Generate tasks based on parent directory of each pattern.
+ */
+function generate(patterns, options) {
+ var unixPatterns = patterns.map(patternUtils.unixifyPattern);
+ var unixIgnore = options.ignore.map(patternUtils.unixifyPattern);
+ var positivePatterns = getPositivePatterns(unixPatterns);
+ var negativePatterns = getNegativePatternsAsPositive(unixPatterns, unixIgnore);
+ var staticPatterns = positivePatterns.filter(patternUtils.isStaticPattern);
+ var dynamicPatterns = positivePatterns.filter(patternUtils.isDynamicPattern);
+ var staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
+ var dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
+ return staticTasks.concat(dynamicTasks);
+}
+exports.generate = generate;
+/**
+ * Convert patterns to tasks based on parent directory of each pattern.
+ */
+function convertPatternsToTasks(positive, negative, dynamic) {
+ var 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) {
+ var task = convertPatternGroupToTask('.', positive, negative, dynamic);
+ return [task];
+ }
+ return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic);
+}
+exports.convertPatternsToTasks = convertPatternsToTasks;
+/**
+ * Return only positive patterns.
+ */
+function getPositivePatterns(patterns) {
+ return patternUtils.getPositivePatterns(patterns);
+}
+exports.getPositivePatterns = getPositivePatterns;
+/**
+ * Return only negative patterns.
+ */
+function getNegativePatternsAsPositive(patterns, ignore) {
+ var negative = patternUtils.getNegativePatterns(patterns).concat(ignore);
+ var positive = negative.map(patternUtils.convertToPositivePattern);
+ return positive;
+}
+exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
+/**
+ * Group patterns by base directory of each pattern.
+ */
+function groupPatternsByBaseDirectory(patterns) {
+ return patterns.reduce(function (collection, pattern) {
+ var base = patternUtils.getBaseDirectory(pattern);
+ if (base in collection) {
+ collection[base].push(pattern);
+ }
+ else {
+ collection[base] = [pattern];
+ }
+ return collection;
+ }, {});
+}
+exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
+/**
+ * Convert group of patterns to tasks.
+ */
+function convertPatternGroupsToTasks(positive, negative, dynamic) {
+ return Object.keys(positive).map(function (base) {
+ return convertPatternGroupToTask(base, positive[base], negative, dynamic);
+ });
+}
+exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
+/**
+ * Create a task for positive and negative patterns.
+ */
+function convertPatternGroupToTask(base, positive, negative, dynamic) {
+ return {
+ base: base,
+ dynamic: dynamic,
+ patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern)),
+ positive: positive,
+ negative: negative
+ };
+}
+exports.convertPatternGroupToTask = convertPatternGroupToTask;