deps: tinyglobby@0.2.17 · npm/cli@2d74bfb · GitHub
Skip to content

Commit 2d74bfb

Browse files
author
Michael Smith
committed
deps: tinyglobby@0.2.17
1 parent c1edadd commit 2d74bfb

6 files changed

Lines changed: 42 additions & 43 deletions

File tree

‎node_modules/tinyglobby/dist/index.cjs‎

Lines changed: 19 additions & 18 deletions

‎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

0 commit comments

Comments
 (0)