-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
Open
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Description
What is the problem this feature will solve?
Would allow for the dynamic creation of glob patterns from arbitrary paths.
Example:
const pattern = `${path.escapeGlob(import.meta.dirname)}/*`;What is the feature you are proposing to solve the problem?
Something similar in functionality to this:
// Wraps symbols which open groups `{`, `[`, `(`, and
// those with semantics independent of groups `*`, `?`
path.escapeGlob = (x = "") => x.replace(/([*{[(?])/g, "[$1]");And this:
// inverse path.escapeGlob
path.unescapeGlob = (x = "") => x.replace(/\[(.)\]/g, "$1");I was using #58988 as a reference for special chars.
What alternatives have you considered?
Using a user land package everywhere dynamic glob creation is required, or even for everything glob related to keep things consistent.
Xstoudi
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.
Type
Projects
Status
Awaiting Triage