An open API service indexing awesome lists of open source software.

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.

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' ) ); // => true

zeptomatch ( escape ( '*.js' ), 'a.js' ) ); // => false
zeptomatch ( escape ( '*.js' ), '*.js' ) ); // => true
```

## License

MIT © Fabio Spampinato