Skip to content

Commit 95bfc4c

Browse files
committed
deps: tinyglobby@0.2.17
1 parent 8c0d5fd commit 95bfc4c

6 files changed

Lines changed: 42 additions & 43 deletions

File tree

node_modules/tinyglobby/dist/index.cjs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ let path = require("path");
2626
let url = require("url");
2727
let fdir = require("fdir");
2828
let picomatch = require("picomatch");
29-
picomatch = __toESM(picomatch);
29+
picomatch = __toESM(picomatch, 1);
3030
//#region src/utils.ts
3131
const isReadonlyArray = Array.isArray;
3232
const BACKSLASHES = /\\/g;
33+
const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
3334
const isWin = process.platform === "win32";
3435
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
3536
function getPartialMatcher(patterns, options = {}) {
@@ -96,18 +97,21 @@ function buildRelative(cwd, root) {
9697
return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
9798
};
9899
}
100+
function ensureNonDriveRelativePath(path$1) {
101+
return path$1.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
102+
}
99103
const splitPatternOptions = { parts: true };
100-
function splitPattern(path$1) {
104+
function splitPattern(path$2) {
101105
var _result$parts;
102-
const result = picomatch.default.scan(path$1, splitPatternOptions);
103-
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$1];
106+
const result = picomatch.default.scan(path$2, splitPatternOptions);
107+
return ((_result$parts = result.parts) === null || _result$parts === void 0 ? void 0 : _result$parts.length) ? result.parts : [path$2];
104108
}
105109
const ESCAPED_WIN32_BACKSLASHES = /\\(?![()[\]{}!+@])/g;
106-
function convertPosixPathToPattern(path$2) {
107-
return escapePosixPath(path$2);
110+
function convertPosixPathToPattern(path$3) {
111+
return escapePosixPath(path$3);
108112
}
109-
function convertWin32PathToPattern(path$3) {
110-
return escapeWin32Path(path$3).replace(ESCAPED_WIN32_BACKSLASHES, "/");
113+
function convertWin32PathToPattern(path$4) {
114+
return escapeWin32Path(path$4).replace(ESCAPED_WIN32_BACKSLASHES, "/");
111115
}
112116
/**
113117
* Converts a path to a pattern depending on the platform.
@@ -118,8 +122,8 @@ function convertWin32PathToPattern(path$3) {
118122
const convertPathToPattern = isWin ? convertWin32PathToPattern : convertPosixPathToPattern;
119123
const POSIX_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g;
120124
const WIN32_UNESCAPED_GLOB_SYMBOLS = /(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g;
121-
const escapePosixPath = (path$4) => path$4.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
122-
const escapeWin32Path = (path$5) => path$5.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
125+
const escapePosixPath = (path$5) => path$5.replace(POSIX_UNESCAPED_GLOB_SYMBOLS, "\\$&");
126+
const escapeWin32Path = (path$6) => path$6.replace(WIN32_UNESCAPED_GLOB_SYMBOLS, "\\$&");
123127
/**
124128
* Escapes a path's special characters depending on the platform.
125129
* @see {@link https://superchupu.dev/tinyglobby/documentation#escapePath}
@@ -173,7 +177,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
173177
}
174178
const potentialRoot = path.posix.join(cwd, parentDir.slice(i * 3));
175179
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
176-
props.root = potentialRoot;
180+
props.root = ensureNonDriveRelativePath(potentialRoot);
177181
props.depthOffset = -n + i;
178182
}
179183
}
@@ -193,7 +197,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
193197
}
194198
props.depthOffset = newCommonPath.length;
195199
props.commonPath = newCommonPath;
196-
props.root = newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd;
200+
props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? path.posix.join(cwd, ...newCommonPath) : cwd);
197201
}
198202
return result;
199203
}
@@ -286,18 +290,15 @@ function formatPaths(paths, mapper) {
286290
}
287291
const defaultOptions = {
288292
caseSensitiveMatch: true,
289-
cwd: process.cwd(),
290293
debug: !!process.env.TINYGLOBBY_DEBUG,
291294
expandDirectories: true,
292295
followSymbolicLinks: true,
293296
onlyFiles: true
294297
};
295298
function getOptions(options) {
296-
const opts = {
297-
...defaultOptions,
298-
...options
299-
};
300-
opts.cwd = (opts.cwd instanceof URL ? (0, url.fileURLToPath)(opts.cwd) : (0, path.resolve)(opts.cwd)).replace(BACKSLASHES, "/");
299+
const opts = Object.assign({}, options);
300+
for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] });
301+
opts.cwd = (opts.cwd instanceof URL ? (0, url.fileURLToPath)(opts.cwd) : (0, path.resolve)(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
301302
opts.ignore = ensureStringArray(opts.ignore);
302303
opts.fs && (opts.fs = {
303304
readdir: opts.fs.readdir || fs.readdir,

node_modules/tinyglobby/dist/index.d.cts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ declare function globSync(patterns: string | readonly string[], options?: Omit<G
145145
*/
146146
declare function globSync(options: GlobOptions): string[];
147147
//#endregion
148-
export { type GlobOptions, convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };
148+
export { type FileSystemAdapter, type GlobOptions, convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };

node_modules/tinyglobby/dist/index.d.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ declare function globSync(patterns: string | readonly string[], options?: Omit<G
145145
*/
146146
declare function globSync(options: GlobOptions): string[];
147147
//#endregion
148-
export { type GlobOptions, convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };
148+
export { type FileSystemAdapter, type GlobOptions, convertPathToPattern, escapePath, glob, globSync, isDynamicPattern };

node_modules/tinyglobby/dist/index.mjs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import picomatch from "picomatch";
66
//#region src/utils.ts
77
const isReadonlyArray = Array.isArray;
88
const BACKSLASHES = /\\/g;
9+
const DRIVE_RELATIVE_PATH = /^[A-Za-z]:$/;
910
const isWin = process.platform === "win32";
1011
const ONLY_PARENT_DIRECTORIES = /^(\/?\.\.)+$/;
1112
function getPartialMatcher(patterns, options = {}) {
@@ -72,6 +73,9 @@ function buildRelative(cwd, root) {
7273
return p[p.length - 1] === "/" && result !== "" ? `${result}/` : result || ".";
7374
};
7475
}
76+
function ensureNonDriveRelativePath(path) {
77+
return path.replace(DRIVE_RELATIVE_PATH, (match) => `${match}/`);
78+
}
7579
const splitPatternOptions = { parts: true };
7680
function splitPattern(path) {
7781
var _result$parts;
@@ -149,7 +153,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
149153
}
150154
const potentialRoot = posix.join(cwd, parentDir.slice(i * 3));
151155
if (potentialRoot[0] !== "." && props.root.length > potentialRoot.length) {
152-
props.root = potentialRoot;
156+
props.root = ensureNonDriveRelativePath(potentialRoot);
153157
props.depthOffset = -n + i;
154158
}
155159
}
@@ -169,7 +173,7 @@ function normalizePattern(pattern, opts, props, isIgnore) {
169173
}
170174
props.depthOffset = newCommonPath.length;
171175
props.commonPath = newCommonPath;
172-
props.root = newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd;
176+
props.root = ensureNonDriveRelativePath(newCommonPath.length > 0 ? posix.join(cwd, ...newCommonPath) : cwd);
173177
}
174178
return result;
175179
}
@@ -262,18 +266,15 @@ function formatPaths(paths, mapper) {
262266
}
263267
const defaultOptions = {
264268
caseSensitiveMatch: true,
265-
cwd: process.cwd(),
266269
debug: !!process.env.TINYGLOBBY_DEBUG,
267270
expandDirectories: true,
268271
followSymbolicLinks: true,
269272
onlyFiles: true
270273
};
271274
function getOptions(options) {
272-
const opts = {
273-
...defaultOptions,
274-
...options
275-
};
276-
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd)).replace(BACKSLASHES, "/");
275+
const opts = Object.assign({}, options);
276+
for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] });
277+
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath(opts.cwd) : resolve(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
277278
opts.ignore = ensureStringArray(opts.ignore);
278279
opts.fs && (opts.fs = {
279280
readdir: opts.fs.readdir || readdir,

node_modules/tinyglobby/package.json

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tinyglobby",
3-
"version": "0.2.16",
3+
"version": "0.2.17",
44
"description": "A fast and minimal alternative to globby and fast-glob",
55
"type": "module",
66
"main": "./dist/index.cjs",
@@ -22,8 +22,8 @@
2222
"keywords": [
2323
"glob",
2424
"patterns",
25-
"fast",
26-
"implementation"
25+
"tiny",
26+
"fast"
2727
],
2828
"repository": {
2929
"type": "git",
@@ -41,22 +41,19 @@
4141
"picomatch": "^4.0.4"
4242
},
4343
"devDependencies": {
44-
"@biomejs/biome": "^2.4.10",
45-
"@types/node": "^25.5.2",
44+
"@biomejs/biome": "^2.4.16",
45+
"@types/node": "^25.9.1",
4646
"@types/picomatch": "^4.0.3",
4747
"fast-glob": "^3.3.3",
48-
"fs-fixture": "^2.13.0",
48+
"fs-fixture": "^2.14.0",
4949
"glob": "^13.0.6",
50-
"tinybench": "^6.0.0",
51-
"tsdown": "^0.21.7",
52-
"typescript": "^6.0.2"
50+
"tinybench": "^6.0.2",
51+
"tsdown": "^0.22.1",
52+
"typescript": "^6.0.3"
5353
},
5454
"engines": {
5555
"node": ">=12.0.0"
5656
},
57-
"publishConfig": {
58-
"provenance": true
59-
},
6057
"scripts": {
6158
"bench": "node benchmark/bench.ts",
6259
"bench:setup": "node benchmark/setup.ts",

package-lock.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13640,9 +13640,9 @@
1364013640
}
1364113641
},
1364213642
"node_modules/tinyglobby": {
13643-
"version": "0.2.16",
13644-
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",
13645-
"integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==",
13643+
"version": "0.2.17",
13644+
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
13645+
"integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",
1364613646
"inBundle": true,
1364713647
"license": "MIT",
1364813648
"dependencies": {

0 commit comments

Comments
 (0)