File tree 4 files changed +32
-2
lines changed
4 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 1
1
language : node_js
2
2
node_js :
3
+ - ' 12'
3
4
- ' 10'
4
5
- ' 8'
Original file line number Diff line number Diff line change
1
+ /**
2
+ Regular expression for matching [semver](https://github.com/npm/node-semver) versions.
3
+
4
+ @example
5
+ ```
6
+ import semverRegex = require('semver-regex');
7
+
8
+ semverRegex().test('v1.0.0');
9
+ //=> true
10
+
11
+ semverRegex().test('1.2.3-alpha.10.beta.0+build.unicorn.rainbow');
12
+ //=> true
13
+
14
+ semverRegex().exec('unicorn 1.0.0 rainbow')[0];
15
+ //=> '1.0.0'
16
+
17
+ 'unicorn 1.0.0 and rainbow 2.1.3'.match(semverRegex());
18
+ //=> ['1.0.0', '2.1.3']
19
+ ```
20
+ */
21
+ declare function semverRegex ( ) : RegExp ;
22
+
23
+ export = semverRegex ;
Original file line number Diff line number Diff line change
1
+ import { expectType } from 'tsd' ;
2
+ import semverRegex = require( '.' ) ;
3
+
4
+ expectType < RegExp > ( semverRegex ( ) ) ;
Original file line number Diff line number Diff line change 13
13
"node" : " >=8"
14
14
},
15
15
"scripts" : {
16
- "test" : " xo && ava"
16
+ "test" : " xo && ava && tsd "
17
17
},
18
18
"files" : [
19
- " index.js"
19
+ " index.js" ,
20
+ " index.d.ts"
20
21
],
21
22
"keywords" : [
22
23
" semver" ,
30
31
],
31
32
"devDependencies" : {
32
33
"ava" : " ^1.4.1" ,
34
+ "tsd" : " ^0.7.2" ,
33
35
"xo" : " ^0.24.0"
34
36
}
35
37
}
You can’t perform that action at this time.
0 commit comments