File tree 3 files changed +18
-2
lines changed
3 files changed +18
-2
lines changed Original file line number Diff line number Diff line change
1
+ declare function parseDate ( isoDate : string ) : Date | number | null
2
+ declare function parseDate ( isoDate : null | undefined ) : null
3
+ export default parseDate
Original file line number Diff line number Diff line change
1
+ import { expectType , expectError } from 'tsd'
2
+
3
+ import parse from '.'
4
+
5
+ expectType < Date | number | null > ( parse ( '2010-12-11 09:09:04' ) )
6
+ expectType < Date | number | null > ( parse ( 'infinity' ) )
7
+ expectType < Date | number | null > ( parse ( 'garbage' ) )
8
+ expectType < null > ( parse ( null ) )
9
+ expectType < null > ( parse ( undefined ) )
10
+ expectError ( parse ( 1625042787 ) )
11
+ expectError ( parse ( new Date ( ) ) )
Original file line number Diff line number Diff line change 14
14
"node" : " >=12"
15
15
},
16
16
"scripts" : {
17
- "test" : " standard && tape test.js"
17
+ "test" : " standard && tape test.js && tsd "
18
18
},
19
19
"keywords" : [
20
20
" postgres" ,
24
24
"dependencies" : {},
25
25
"devDependencies" : {
26
26
"standard" : " ^16.0.0" ,
27
- "tape" : " ^5.0.0"
27
+ "tape" : " ^5.0.0" ,
28
+ "tsd" : " ^0.17.0"
28
29
},
29
30
"files" : [
30
31
" index.js" ,
32
+ " index.d.ts" ,
31
33
" readme.md"
32
34
]
33
35
}
You can’t perform that action at this time.
0 commit comments