Skip to content

Commit d002ea8

Browse files
Using the standalone "zeptomatch-escape" utility
1 parent c342780 commit d002ea8

File tree

3 files changed

+59
-9
lines changed

3 files changed

+59
-9
lines changed

package-lock.json

+54-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@
5050
"tiny-readdir-glob": "^1.22.24",
5151
"tiny-spinner": "^2.0.3",
5252
"worktank": "^2.6.1",
53-
"zeptomatch": "^1.2.2"
53+
"zeptomatch": "^2.0.0",
54+
"zeptomatch-escape": "^1.0.0"
5455
},
5556
"devDependencies": {
5657
"@types/js-yaml": "^4.0.9",

src/utils.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import url from "node:url";
88
import { exit } from "specialist";
99
import readdir from "tiny-readdir-glob";
1010
import zeptomatch from "zeptomatch";
11+
import zeptomatchEscape from "zeptomatch-escape";
1112
import type { ContextOptions, FormatOptions, FunctionMaybe, Key, LogLevel, Options, PrettierConfigWithOverrides, PrettierPlugin } from "./types.js";
1213
import type { PluginsOptions, PromiseMaybe } from "./types.js";
1314

@@ -284,7 +285,8 @@ function normalizeOptions(options: unknown, targets: unknown[]): Options {
284285
if (!isObject(options)) exit("Invalid options object");
285286

286287
const targetsGlobs = targets.filter(isString);
287-
const targetsStatic = "--" in options && Array.isArray(options["--"]) ? options["--"].filter(isString).map(zeptomatch.escape) : [];
288+
289+
const targetsStatic = "--" in options && Array.isArray(options["--"]) ? options["--"].filter(isString).map(zeptomatchEscape) : [];
288290
const globs = [...targetsGlobs, ...targetsStatic];
289291

290292
if (!globs.length) exit("Expected at least one target file/dir/glob");

0 commit comments

Comments
 (0)