Skip to content

Commit 506bdcc

Browse files
committed
fix: use correct parameter ordering in TS
1 parent 5ef3b3d commit 506bdcc

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

lib/node_modules/@stdlib/utils/until/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type Predicate = ( i: number ) => boolean;
5151
*
5252
* until( predicate, beep );
5353
*/
54-
declare function until<T extends Function>( fcn: T, predicate: Predicate, thisArg?: ThisParameterType<T> ): void;
54+
declare function until<T extends Function>( predicate: Predicate, fcn: T, thisArg?: ThisParameterType<T> ): void;
5555

5656

5757
// EXPORTS //

lib/node_modules/@stdlib/utils/until/docs/types/test.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function predicate( i: number ): boolean {
3131
/**
3232
* Empty function.
3333
*/
34-
function noop() {
34+
function noop(): void {
3535
// Body is empty...
3636
}
3737

@@ -40,32 +40,32 @@ function noop() {
4040

4141
// The function does not return a value...
4242
{
43-
until( noop, predicate ); // $ExpectType void
44-
until( noop, predicate, {} ); // $ExpectType void
43+
until( predicate, noop ); // $ExpectType void
44+
until( predicate, noop, {} ); // $ExpectType void
4545
}
4646

4747
// The compiler throws an error if the function is provided a first argument which is not a function...
4848
{
49-
until( 'abc', predicate ); // $ExpectError
50-
until( 5, predicate ); // $ExpectError
51-
until( true, predicate ); // $ExpectError
52-
until( false, predicate ); // $ExpectError
53-
until( [], predicate ); // $ExpectError
54-
until( {}, predicate ); // $ExpectError
49+
until( 'abc', noop ); // $ExpectError
50+
until( 5, noop ); // $ExpectError
51+
until( true, noop ); // $ExpectError
52+
until( false, noop ); // $ExpectError
53+
until( [], noop ); // $ExpectError
54+
until( {}, noop ); // $ExpectError
5555
}
5656

5757
// The compiler throws an error if the function is provided a second argument which is not a function...
5858
{
59-
until( noop, 'abc' ); // $ExpectError
60-
until( noop, 5 ); // $ExpectError
61-
until( noop, true ); // $ExpectError
62-
until( noop, false ); // $ExpectError
63-
until( noop, [] ); // $ExpectError
64-
until( noop, {} ); // $ExpectError
59+
until( predicate, 'abc' ); // $ExpectError
60+
until( predicate, 5 ); // $ExpectError
61+
until( predicate, true ); // $ExpectError
62+
until( predicate, false ); // $ExpectError
63+
until( predicate, [] ); // $ExpectError
64+
until( predicate, {} ); // $ExpectError
6565
}
6666

6767
// The compiler throws an error if the function is provided fewer than two arguments...
6868
{
6969
until(); // $ExpectError
70-
until( noop ); // $ExpectError
70+
until( predicate ); // $ExpectError
7171
}

0 commit comments

Comments
 (0)