Skip to content

Commit 93231ea

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

File tree

3 files changed

+59
-10
lines changed

3 files changed

+59
-10
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-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import process from "node:process";
77
import url from "node:url";
88
import { exit } from "specialist";
99
import readdir from "tiny-readdir-glob";
10-
import zeptomatch from "zeptomatch";
10+
import zeptomatchEscape from "zeptomatch-escape";
1111
import type { ContextOptions, FormatOptions, FunctionMaybe, Key, LogLevel, Options, PrettierConfigWithOverrides, PrettierPlugin } from "./types.js";
1212
import type { PluginsOptions, PromiseMaybe } from "./types.js";
1313

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

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

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

0 commit comments

Comments
 (0)