Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bradennapier committed Nov 23, 2017
1 parent 2c029c9 commit 9153d3d
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,30 @@ simplistic pattern generator that is used to build the `RegExp` values, you can
import from `wildcard-utils/to-pattern`. For the full-featured version, import
the `Wildcard` class directly.

### Common Flow Types

```js
export type Wildcard$ToPatternTypes =
| string
| Array<string>
| Set<string>
| { [key: string]: * };

export type Wildcard$Config = {
logic: 'and' | 'or',
flags: $CharSet<'gimsuy'>,
};
```

### RegExp Generator

```js
declare function toWildcardPattern(
patterns: Wildcard$ToPatternTypes,
config?: $Shape<Wildcard$Config>,
): RegExp;
```

```js
import toWildcardPattern from 'wildcard-utils/to-pattern';

Expand All @@ -91,21 +113,6 @@ import Wildcard from 'wildcard-utils';
const WC = new Wildcard();
```

#### Common Flow Types

```js
export type Wildcard$ToPatternTypes =
| string
| Array<string>
| Set<string>
| { [key: string]: * };

export type Wildcard$Config = {
logic: 'and' | 'or',
flags: $CharSet<'gimsuy'>,
};
```

#### `.pattern()`

```js
Expand Down

0 comments on commit 9153d3d

Please sign in to comment.