-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee3f101
commit 486db95
Showing
2 changed files
with
15 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { expectType } from 'tsd'; | ||
|
||
import { __, match } from '../es'; | ||
|
||
// not much to test here | ||
expectType<RegExpMatchArray>(match(/foo/, 'foo')); | ||
expectType<RegExpMatchArray>(match(/foo/)('foo')); | ||
expectType<RegExpMatchArray>(match(__, 'foo')(/foo/)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
export function match(regexp: RegExp): (str: string) => string[]; | ||
export function match(regexp: RegExp, str: string): string[]; | ||
import { Placeholder } from './util/tools'; | ||
|
||
// ramda used `Array.prototype.match` in its implementation, but never returns undefined | ||
// See: https://github.com/ramda/ramda/blob/v0.29.1/source/match.js#L26 | ||
export function match(regexp: RegExp): (str: string) => RegExpMatchArray; | ||
export function match(__: Placeholder, str: string): (regexp: RegExp) => RegExpMatchArray; | ||
export function match(regexp: RegExp, str: string): RegExpMatchArray; |