Skip to content

[Feature Request] Provide a path escape function #158

@idevelop

Description

@idevelop

A common developer bug is where paths like /Users/idevelop/Dropbox (Personal)/project/* fail to be expanded because the parentheses are present in __dirname and are interpreted as patterns by fastGlob. Other special characters that throw the globbing off are []+{} etc.

The usual fix I see suggested is to explicitly disable some specific types of patterns, but I think the proper fix is for the absolute path to be properly escaped by the developer before appending the project-folder-specific glob patterns. One hurdle with that is that it's impractical for every dev to write their own escaping function, as they would likely miss some of the special characters.

Would you consider exposing a static function, such as fastGlob.escapePath(path), which would escape all the characters that fastGlob considers special?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions