Skip to content

Commit b923036

Browse files
committed
refactor: rename type and rearrange tests
1 parent d528fff commit b923036

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/node_modules/@stdlib/math/base/tools/normhermitepoly/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @param x - value at which to evaluate a normalized Hermite polynomial
2727
* @returns result
2828
*/
29-
type EvaluationFunction = ( x: number ) => number;
29+
type PolynomialFunction = ( x: number ) => number;
3030

3131
/**
3232
* Interface for evaluating normalized Hermite polynomials.
@@ -69,7 +69,7 @@ interface NormHermitePoly {
6969
* var v = polyval( 0.5 );
7070
* // returns -0.75
7171
*/
72-
factory( n: number ): EvaluationFunction;
72+
factory( n: number ): PolynomialFunction;
7373
}
7474

7575
/**

lib/node_modules/@stdlib/math/base/tools/normhermitepoly/docs/types/test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,17 @@ import normhermitepoly = require( './index' );
5454

5555
// Attached to main export is a `factory` method which returns a function...
5656
{
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
5868
}
5969

6070
// The compiler throws an error if the `factory` method is provided an unsupported number of arguments...
@@ -69,7 +79,7 @@ import normhermitepoly = require( './index' );
6979
polyval( 1.0 ); // $ExpectType number
7080
}
7181

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...
7383
{
7484
const polyval = normhermitepoly.factory( 3 );
7585
polyval( true ); // $ExpectError
@@ -79,13 +89,3 @@ import normhermitepoly = require( './index' );
7989
polyval( {} ); // $ExpectError
8090
polyval( ( x: number ): number => x ); // $ExpectError
8191
}
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

Comments
 (0)