https://github.com/fabiospampinato/zeptomatch-escape
A little utility for escaping globs before passing them to zeptomatch.
https://github.com/fabiospampinato/zeptomatch-escape
escape glob zeptomatch
Last synced: 4 days ago
JSON representation
A little utility for escaping globs before passing them to zeptomatch.
- Host: GitHub
- URL: https://github.com/fabiospampinato/zeptomatch-escape
- Owner: fabiospampinato
- License: mit
- Created: 2024-03-24T23:57:24.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-03-24T23:57:35.000Z (over 1 year ago)
- Last Synced: 2025-01-04T13:02:47.987Z (10 months ago)
- Topics: escape, glob, zeptomatch
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Zeptomatch Escape
A little utility for escaping globs before passing them to [`zeptomatch`](https://github.com/fabiospampinato/zeptomatch).
## Install
```sh
npm install zeptomatch-escape
```## Usage
```ts
import zeptomatch from 'zeptomatch';
import escape from 'zeptomatch-escape';// Escaping special characters from a string
escape ( '*.js' ); // => '\\*.js'
// Example usage
zeptomatch ( '*.js', 'a.js' ) ); // => true
zeptomatch ( '*.js', '*.js' ) ); // => truezeptomatch ( escape ( '*.js' ), 'a.js' ) ); // => false
zeptomatch ( escape ( '*.js' ), '*.js' ) ); // => true
```## License
MIT © Fabio Spampinato