-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
9007bc7
commit faa9e4a
Showing
8 changed files
with
30 additions
and
43 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
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
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
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,4 +1,4 @@ | ||
import {expectType} from 'tsd'; | ||
import execall = require('.'); | ||
import execAll, {Match} from './index.js'; | ||
|
||
expectType<execall.Match[]>(execall(/(\d+)/g, '$200 and $400')); | ||
expectType<Match[]>(execAll(/(\d+)/g, '$200 and $400')); |
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
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
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
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,11 +1,11 @@ | ||
import test from 'ava'; | ||
import execall from '.'; | ||
import execAll from './index.js'; | ||
|
||
test('main', t => { | ||
const result = execall(/(\d+)/, '$200 and $400')[0]; | ||
const result = execAll(/(\d+)/, '$200 and $400')[0]; | ||
t.is(result.match, '200'); | ||
t.is(result.subMatches[0], '200'); | ||
t.is(result.index, 1); | ||
t.is(execall(/\d+/g, '$200 and $400')[1].match, '400'); | ||
t.is(execall(/\d+/g, 'unicorn').length, 0); | ||
t.is(execAll(/\d+/g, '$200 and $400')[1].match, '400'); | ||
t.is(execAll(/\d+/g, 'unicorn').length, 0); | ||
}); |