@@ -54,7 +54,17 @@ import normhermitepoly = require( './index' );
54
54
55
55
// Attached to main export is a `factory` method which returns a function...
56
56
{
57
- normhermitepoly . factory ( 3 ) ; // $ExpectType EvaluationFunction
57
+ normhermitepoly . factory ( 3 ) ; // $ExpectType PolynomialFunction
58
+ }
59
+
60
+ // The compiler throws an error if the `factory` method is provided a first argument which is not a number...
61
+ {
62
+ normhermitepoly . factory ( true ) ; // $ExpectError
63
+ normhermitepoly . factory ( false ) ; // $ExpectError
64
+ normhermitepoly . factory ( 'abc' ) ; // $ExpectError
65
+ normhermitepoly . factory ( [ ] ) ; // $ExpectError
66
+ normhermitepoly . factory ( { } ) ; // $ExpectError
67
+ normhermitepoly . factory ( ( x : number ) : number => x ) ; // $ExpectError
58
68
}
59
69
60
70
// The compiler throws an error if the `factory` method is provided an unsupported number of arguments...
@@ -69,7 +79,7 @@ import normhermitepoly = require( './index' );
69
79
polyval ( 1.0 ) ; // $ExpectType number
70
80
}
71
81
72
- // The `factory` method returns a function which does not compile if provided a first argument which is not a number...
82
+ // The compiler throws an error if the function returned by the `factory` method is provided a first argument which is not a number...
73
83
{
74
84
const polyval = normhermitepoly . factory ( 3 ) ;
75
85
polyval ( true ) ; // $ExpectError
@@ -79,13 +89,3 @@ import normhermitepoly = require( './index' );
79
89
polyval ( { } ) ; // $ExpectError
80
90
polyval ( ( x : number ) : number => x ) ; // $ExpectError
81
91
}
82
-
83
- // The compiler throws an error if the `factory` method is provided a first argument which is not a number...
84
- {
85
- normhermitepoly . factory ( true ) ; // $ExpectError
86
- normhermitepoly . factory ( false ) ; // $ExpectError
87
- normhermitepoly . factory ( 'abc' ) ; // $ExpectError
88
- normhermitepoly . factory ( [ ] ) ; // $ExpectError
89
- normhermitepoly . factory ( { } ) ; // $ExpectError
90
- normhermitepoly . factory ( ( x : number ) : number => x ) ; // $ExpectError
91
- }
0 commit comments