Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added typescript support #8

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export = Matcher;
declare function Matcher(input: string[], patterns: string[]) : string[];

declare namespace Matcher{
export function isMatch(input: string, pattern: string) : boolean;
}
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ Useful when you want to accept loose string input and regexes/globs are too conv
$ npm install --save matcher
```

## Import

```js
const matcher = require('matcher');
```

```js
import * as matcher from "matcher"
```

## Usage

Expand Down Expand Up @@ -74,6 +83,9 @@ Case-insensitive. Use `*` to match zero or more characters. A pattern starting w
$ npm run bench
```

## Typescript

Includes [TypeScript](http://typescriptlang.org) definitions inside this project

## Related

Expand Down