mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-17 06:47:09 +01:00
Update packages
This commit is contained in:
parent
c032c9b993
commit
bd65e34c96
24 changed files with 10884 additions and 8895 deletions
303
dist/index.js
generated
vendored
303
dist/index.js
generated
vendored
|
|
@ -179,13 +179,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.LocalFileProvider = void 0;
|
||||
const fs = __importStar(__nccwpck_require__(7147));
|
||||
const fast_glob_1 = __importDefault(__nccwpck_require__(3664));
|
||||
const fast_glob_1 = __nccwpck_require__(3664);
|
||||
const git_1 = __nccwpck_require__(9844);
|
||||
class LocalFileProvider {
|
||||
constructor(name, pattern) {
|
||||
|
|
@ -196,7 +193,7 @@ class LocalFileProvider {
|
|||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const result = [];
|
||||
for (const pat of this.pattern) {
|
||||
const paths = yield (0, fast_glob_1.default)(pat, { dot: true });
|
||||
const paths = yield (0, fast_glob_1.glob)(pat, { dot: true });
|
||||
for (const file of paths) {
|
||||
const content = yield fs.promises.readFile(file, { encoding: 'utf8' });
|
||||
result.push({ file, content });
|
||||
|
|
@ -2169,10 +2166,10 @@ var Align;
|
|||
Align["Center"] = ":---:";
|
||||
Align["Right"] = "---:";
|
||||
Align["None"] = "---";
|
||||
})(Align = exports.Align || (exports.Align = {}));
|
||||
})(Align || (exports.Align = Align = {}));
|
||||
exports.Icon = {
|
||||
skip: '⚪',
|
||||
success: '🟢',
|
||||
skip: '⚪', // ':heavy_multiplication_x:'
|
||||
success: '🟢', // ':heavy_check_mark:'
|
||||
fail: '🔴' // ':x:'
|
||||
};
|
||||
function link(title, address) {
|
||||
|
|
@ -14727,7 +14724,6 @@ module.exports = function globParent(str, opts) {
|
|||
"use strict";
|
||||
|
||||
const taskManager = __nccwpck_require__(2708);
|
||||
const patternManager = __nccwpck_require__(8306);
|
||||
const async_1 = __nccwpck_require__(5679);
|
||||
const stream_1 = __nccwpck_require__(4630);
|
||||
const sync_1 = __nccwpck_require__(2405);
|
||||
|
|
@ -14742,6 +14738,10 @@ async function FastGlob(source, options) {
|
|||
// https://github.com/typescript-eslint/typescript-eslint/issues/60
|
||||
// eslint-disable-next-line no-redeclare
|
||||
(function (FastGlob) {
|
||||
FastGlob.glob = FastGlob;
|
||||
FastGlob.globSync = sync;
|
||||
FastGlob.globStream = stream;
|
||||
FastGlob.async = FastGlob;
|
||||
function sync(source, options) {
|
||||
assertPatternsInput(source);
|
||||
const works = getWorks(source, sync_1.default, options);
|
||||
|
|
@ -14761,7 +14761,7 @@ async function FastGlob(source, options) {
|
|||
FastGlob.stream = stream;
|
||||
function generateTasks(source, options) {
|
||||
assertPatternsInput(source);
|
||||
const patterns = patternManager.transform([].concat(source));
|
||||
const patterns = [].concat(source);
|
||||
const settings = new settings_1.default(options);
|
||||
return taskManager.generate(patterns, settings);
|
||||
}
|
||||
|
|
@ -14777,9 +14777,40 @@ async function FastGlob(source, options) {
|
|||
return utils.path.escape(source);
|
||||
}
|
||||
FastGlob.escapePath = escapePath;
|
||||
function convertPathToPattern(source) {
|
||||
assertPatternsInput(source);
|
||||
return utils.path.convertPathToPattern(source);
|
||||
}
|
||||
FastGlob.convertPathToPattern = convertPathToPattern;
|
||||
let posix;
|
||||
(function (posix) {
|
||||
function escapePath(source) {
|
||||
assertPatternsInput(source);
|
||||
return utils.path.escapePosixPath(source);
|
||||
}
|
||||
posix.escapePath = escapePath;
|
||||
function convertPathToPattern(source) {
|
||||
assertPatternsInput(source);
|
||||
return utils.path.convertPosixPathToPattern(source);
|
||||
}
|
||||
posix.convertPathToPattern = convertPathToPattern;
|
||||
})(posix = FastGlob.posix || (FastGlob.posix = {}));
|
||||
let win32;
|
||||
(function (win32) {
|
||||
function escapePath(source) {
|
||||
assertPatternsInput(source);
|
||||
return utils.path.escapeWindowsPath(source);
|
||||
}
|
||||
win32.escapePath = escapePath;
|
||||
function convertPathToPattern(source) {
|
||||
assertPatternsInput(source);
|
||||
return utils.path.convertWindowsPathToPattern(source);
|
||||
}
|
||||
win32.convertPathToPattern = convertPathToPattern;
|
||||
})(win32 = FastGlob.win32 || (FastGlob.win32 = {}));
|
||||
})(FastGlob || (FastGlob = {}));
|
||||
function getWorks(source, _Provider, options) {
|
||||
const patterns = patternManager.transform([].concat(source));
|
||||
const patterns = [].concat(source);
|
||||
const settings = new settings_1.default(options);
|
||||
const tasks = taskManager.generate(patterns, settings);
|
||||
const provider = new _Provider(settings);
|
||||
|
|
@ -14795,35 +14826,6 @@ function assertPatternsInput(input) {
|
|||
module.exports = FastGlob;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 8306:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.removeDuplicateSlashes = exports.transform = void 0;
|
||||
/**
|
||||
* Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
|
||||
* The latter is due to the presence of the device path at the beginning of the UNC path.
|
||||
* @todo rewrite to negative lookbehind with the next major release.
|
||||
*/
|
||||
const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
|
||||
function transform(patterns) {
|
||||
return patterns.map((pattern) => removeDuplicateSlashes(pattern));
|
||||
}
|
||||
exports.transform = transform;
|
||||
/**
|
||||
* This package only works with forward slashes as a path separator.
|
||||
* Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
|
||||
*/
|
||||
function removeDuplicateSlashes(pattern) {
|
||||
return pattern.replace(DOUBLE_SLASH_RE, '/');
|
||||
}
|
||||
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 2708:
|
||||
|
|
@ -14834,9 +14836,11 @@ exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
|||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
|
||||
const utils = __nccwpck_require__(5444);
|
||||
function generate(patterns, settings) {
|
||||
function generate(input, settings) {
|
||||
const patterns = processPatterns(input, settings);
|
||||
const ignore = processPatterns(settings.ignore, settings);
|
||||
const positivePatterns = getPositivePatterns(patterns);
|
||||
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
|
||||
const negativePatterns = getNegativePatternsAsPositive(patterns, 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);
|
||||
|
|
@ -14844,6 +14848,34 @@ function generate(patterns, settings) {
|
|||
return staticTasks.concat(dynamicTasks);
|
||||
}
|
||||
exports.generate = generate;
|
||||
function processPatterns(input, settings) {
|
||||
let patterns = input;
|
||||
/**
|
||||
* The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry
|
||||
* and some problems with the micromatch package (see fast-glob issues: #365, #394).
|
||||
*
|
||||
* To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown
|
||||
* in matching in the case of a large set of patterns after expansion.
|
||||
*/
|
||||
if (settings.braceExpansion) {
|
||||
patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
|
||||
}
|
||||
/**
|
||||
* If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used
|
||||
* at any nesting level.
|
||||
*
|
||||
* We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change
|
||||
* the pattern in the filter before creating a regular expression. There is no need to change the patterns
|
||||
* in the application. Only on the input.
|
||||
*/
|
||||
if (settings.baseNameMatch) {
|
||||
patterns = patterns.map((pattern) => pattern.includes('/') ? pattern : `**/${pattern}`);
|
||||
}
|
||||
/**
|
||||
* This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion.
|
||||
*/
|
||||
return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern));
|
||||
}
|
||||
/**
|
||||
* Returns tasks grouped by basic pattern directories.
|
||||
*
|
||||
|
|
@ -14920,23 +14952,18 @@ exports.convertPatternGroupToTask = convertPatternGroupToTask;
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const stream_1 = __nccwpck_require__(2083);
|
||||
const async_1 = __nccwpck_require__(7747);
|
||||
const provider_1 = __nccwpck_require__(257);
|
||||
class ProviderAsync extends provider_1.default {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._reader = new stream_1.default(this._settings);
|
||||
this._reader = new async_1.default(this._settings);
|
||||
}
|
||||
read(task) {
|
||||
async 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));
|
||||
});
|
||||
const entries = await this.api(root, task, options);
|
||||
return entries.map((entry) => options.transform(entry));
|
||||
}
|
||||
api(root, task, options) {
|
||||
if (task.dynamic) {
|
||||
|
|
@ -15035,31 +15062,32 @@ class EntryFilter {
|
|||
}
|
||||
getFilter(positive, negative) {
|
||||
const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
|
||||
const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
|
||||
const negativeRe = utils.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }));
|
||||
return (entry) => this._filter(entry, positiveRe, negativeRe);
|
||||
}
|
||||
_filter(entry, positiveRe, negativeRe) {
|
||||
if (this._settings.unique && this._isDuplicateEntry(entry)) {
|
||||
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;
|
||||
}
|
||||
if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
|
||||
if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) {
|
||||
return false;
|
||||
}
|
||||
const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
|
||||
const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
|
||||
const isDirectory = entry.dirent.isDirectory();
|
||||
const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory);
|
||||
if (this._settings.unique && isMatched) {
|
||||
this._createIndexRecord(entry);
|
||||
this._createIndexRecord(filepath);
|
||||
}
|
||||
return isMatched;
|
||||
}
|
||||
_isDuplicateEntry(entry) {
|
||||
return this.index.has(entry.path);
|
||||
_isDuplicateEntry(filepath) {
|
||||
return this.index.has(filepath);
|
||||
}
|
||||
_createIndexRecord(entry) {
|
||||
this.index.set(entry.path, undefined);
|
||||
_createIndexRecord(filepath) {
|
||||
this.index.set(filepath, undefined);
|
||||
}
|
||||
_onlyFileFilter(entry) {
|
||||
return this._settings.onlyFiles && !entry.dirent.isFile();
|
||||
|
|
@ -15074,13 +15102,15 @@ class EntryFilter {
|
|||
const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
|
||||
return utils.pattern.matchAny(fullpath, patternsRe);
|
||||
}
|
||||
/**
|
||||
* First, just trying to apply patterns to the path.
|
||||
* Second, trying to apply patterns to the path with final slash.
|
||||
*/
|
||||
_isMatchToPatterns(entryPath, patternsRe) {
|
||||
const filepath = utils.path.removeLeadingDotSegment(entryPath);
|
||||
return utils.pattern.matchAny(filepath, patternsRe) || utils.pattern.matchAny(filepath + '/', patternsRe);
|
||||
_isMatchToPatterns(filepath, patternsRe, isDirectory) {
|
||||
// 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;
|
||||
|
|
@ -15127,12 +15157,7 @@ class Matcher {
|
|||
this._fillStorage();
|
||||
}
|
||||
_fillStorage() {
|
||||
/**
|
||||
* The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
|
||||
* So, before expand patterns with brace expansion into separated patterns.
|
||||
*/
|
||||
const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
|
||||
for (const pattern of patterns) {
|
||||
for (const pattern of this._patterns) {
|
||||
const segments = this._getPatternSegments(pattern);
|
||||
const sections = this._splitSegmentsIntoSections(segments);
|
||||
this._storage.push({
|
||||
|
|
@ -15373,6 +15398,49 @@ class EntryTransformer {
|
|||
exports["default"] = EntryTransformer;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 7747:
|
||||
/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
|
||||
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const fsWalk = __nccwpck_require__(6026);
|
||||
const reader_1 = __nccwpck_require__(5582);
|
||||
const stream_1 = __nccwpck_require__(2083);
|
||||
class ReaderAsync extends reader_1.default {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this._walkAsync = fsWalk.walk;
|
||||
this._readerStream = new stream_1.default(this._settings);
|
||||
}
|
||||
dynamic(root, options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
this._walkAsync(root, options, (error, entries) => {
|
||||
if (error === null) {
|
||||
resolve(entries);
|
||||
}
|
||||
else {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
async static(patterns, options) {
|
||||
const entries = [];
|
||||
const stream = this._readerStream.static(patterns, options);
|
||||
// After #235, replace it with an asynchronous iterator.
|
||||
return new Promise((resolve, reject) => {
|
||||
stream.once('error', reject);
|
||||
stream.on('data', (entry) => entries.push(entry));
|
||||
stream.once('end', () => resolve(entries));
|
||||
});
|
||||
}
|
||||
}
|
||||
exports["default"] = ReaderAsync;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5582:
|
||||
|
|
@ -15582,6 +15650,8 @@ class Settings {
|
|||
if (this.stats) {
|
||||
this.objectMode = true;
|
||||
}
|
||||
// Remove the cast to the array in the next major (#404).
|
||||
this.ignore = [].concat(this.ignore);
|
||||
}
|
||||
_getValue(option, value) {
|
||||
return option === undefined ? value : option;
|
||||
|
|
@ -15698,10 +15768,29 @@ exports.string = string;
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0;
|
||||
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
||||
const os = __nccwpck_require__(2037);
|
||||
const path = __nccwpck_require__(1017);
|
||||
const IS_WINDOWS_PLATFORM = os.platform() === 'win32';
|
||||
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
|
||||
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
|
||||
/**
|
||||
* All non-escaped special characters.
|
||||
* Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters.
|
||||
* Windows: (){}[], !+@ before (, ! at the beginning.
|
||||
*/
|
||||
const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
|
||||
const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
|
||||
/**
|
||||
* The device path (\\.\ or \\?\).
|
||||
* https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths
|
||||
*/
|
||||
const DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
|
||||
/**
|
||||
* All backslashes except those escaping special characters.
|
||||
* Windows: !()+@{}
|
||||
* https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
|
||||
*/
|
||||
const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
|
||||
/**
|
||||
* Designed to work only with simple paths: `dir\\file`.
|
||||
*/
|
||||
|
|
@ -15713,10 +15802,6 @@ 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;
|
||||
function removeLeadingDotSegment(entry) {
|
||||
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
||||
|
|
@ -15729,6 +15814,26 @@ function removeLeadingDotSegment(entry) {
|
|||
return entry;
|
||||
}
|
||||
exports.removeLeadingDotSegment = removeLeadingDotSegment;
|
||||
exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
|
||||
function escapeWindowsPath(pattern) {
|
||||
return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
||||
}
|
||||
exports.escapeWindowsPath = escapeWindowsPath;
|
||||
function escapePosixPath(pattern) {
|
||||
return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
|
||||
}
|
||||
exports.escapePosixPath = escapePosixPath;
|
||||
exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
|
||||
function convertWindowsPathToPattern(filepath) {
|
||||
return escapeWindowsPath(filepath)
|
||||
.replace(DOS_DEVICE_PATH_RE, '//$1')
|
||||
.replace(WINDOWS_BACKSLASHES_RE, '/');
|
||||
}
|
||||
exports.convertWindowsPathToPattern = convertWindowsPathToPattern;
|
||||
function convertPosixPathToPattern(filepath) {
|
||||
return escapePosixPath(filepath);
|
||||
}
|
||||
exports.convertPosixPathToPattern = convertPosixPathToPattern;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
@ -15739,7 +15844,7 @@ exports.removeLeadingDotSegment = removeLeadingDotSegment;
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
||||
exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
||||
const path = __nccwpck_require__(1017);
|
||||
const globParent = __nccwpck_require__(4460);
|
||||
const micromatch = __nccwpck_require__(6228);
|
||||
|
|
@ -15750,6 +15855,11 @@ const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
|
|||
const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
|
||||
const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
|
||||
const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
|
||||
/**
|
||||
* Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
|
||||
* The latter is due to the presence of the device path at the beginning of the UNC path.
|
||||
*/
|
||||
const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
|
||||
function isStaticPattern(pattern, options = {}) {
|
||||
return !isDynamicPattern(pattern, options);
|
||||
}
|
||||
|
|
@ -15868,10 +15978,16 @@ function expandPatternsWithBraceExpansion(patterns) {
|
|||
}
|
||||
exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
|
||||
function expandBraceExpansion(pattern) {
|
||||
return micromatch.braces(pattern, {
|
||||
expand: true,
|
||||
nodupes: true
|
||||
});
|
||||
const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
|
||||
/**
|
||||
* Sort the patterns by length so that the same depth patterns are processed side by side.
|
||||
* `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']`
|
||||
*/
|
||||
patterns.sort((a, b) => a.length - b.length);
|
||||
/**
|
||||
* Micromatch can return an empty string in the case of patterns like `{a,}`.
|
||||
*/
|
||||
return patterns.filter((pattern) => pattern !== '');
|
||||
}
|
||||
exports.expandBraceExpansion = expandBraceExpansion;
|
||||
function getPatternParts(pattern, options) {
|
||||
|
|
@ -15906,6 +16022,14 @@ function matchAny(entry, patternsRe) {
|
|||
return patternsRe.some((patternRe) => patternRe.test(entry));
|
||||
}
|
||||
exports.matchAny = matchAny;
|
||||
/**
|
||||
* This package only works with forward slashes as a path separator.
|
||||
* Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
|
||||
*/
|
||||
function removeDuplicateSlashes(pattern) {
|
||||
return pattern.replace(DOUBLE_SLASH_RE, '/');
|
||||
}
|
||||
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
@ -19325,6 +19449,7 @@ const statusCodeCacheableByDefault = new Set([
|
|||
206,
|
||||
300,
|
||||
301,
|
||||
308,
|
||||
404,
|
||||
405,
|
||||
410,
|
||||
|
|
@ -19397,10 +19522,10 @@ function parseCacheControl(header) {
|
|||
|
||||
// TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives),
|
||||
// the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale
|
||||
const parts = header.trim().split(/\s*,\s*/); // TODO: lame parsing
|
||||
const parts = header.trim().split(/,/);
|
||||
for (const part of parts) {
|
||||
const [k, v] = part.split(/\s*=\s*/, 2);
|
||||
cc[k] = v === undefined ? true : v.replace(/^"|"$/g, ''); // TODO: lame unquoting
|
||||
const [k, v] = part.split(/=/, 2);
|
||||
cc[k.trim()] = v === undefined ? true : v.trim().replace(/^"|"$/g, '');
|
||||
}
|
||||
|
||||
return cc;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue