File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
lib/node_modules/@stdlib/assert/is-almost-equal/docs/types Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,18 @@ import isAlmostEqual = require( './index' );
2828 isAlmostEqual ( 'beep' , 'boop' , 2 ) ; // $ExpectType boolean
2929}
3030
31+ // The compiler throws an error if the function is provided a third argument which is not a number...
32+ {
33+ isAlmostEqual ( 3.14 , 3.14 , '1' ) ; // $ExpectError
34+ isAlmostEqual ( 3.14 , 3.14 , true ) ; // $ExpectError
35+ isAlmostEqual ( 3.14 , 3.14 , false ) ; // $ExpectError
36+ isAlmostEqual ( 3.14 , 3.14 , null ) ; // $ExpectError
37+ isAlmostEqual ( 3.14 , 3.14 , undefined ) ; // $ExpectError
38+ isAlmostEqual ( 3.14 , 3.14 , [ ] ) ; // $ExpectError
39+ isAlmostEqual ( 3.14 , 3.14 , { } ) ; // $ExpectError
40+ isAlmostEqual ( 3.14 , 3.14 , ( x : number ) : number => x ) ; // $ExpectError
41+ }
42+
3143// The compiler throws an error if the function is provided an unsupported number of arguments...
3244{
3345 isAlmostEqual ( ) ; // $ExpectError
You can’t perform that action at this time.
0 commit comments