Skip to content

Commit 3ab7917

Browse files
committed
Require callback signature to have two parameters
1 parent a7babcd commit 3ab7917

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

lib/node_modules/@stdlib/fs/resolve-parent-path/docs/types/index.d.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,13 @@ interface Options {
2828
dir?: string;
2929
}
3030

31-
/**
32-
* Callback invoked after resolving a path.
33-
*/
34-
type Nullary = () => void;
35-
36-
/**
37-
* Callback invoked after resolving a path.
38-
*
39-
* @param err - error argument
40-
*/
41-
type Unary = ( err: Error ) => void;
42-
43-
/**
44-
* Callback invoked after resolving a path.
45-
*
46-
* @param err - error argument
47-
* @param path - resolved path
48-
*/
49-
type Binary = ( err: Error, path: string | null ) => void;
50-
5131
/**
5232
* Callback invoked after resolving a path.
5333
*
5434
* @param err - error argument
5535
* @param path - resolved path
5636
*/
57-
type Callback = Nullary | Unary | Binary;
37+
type Callback = ( err: Error | null, path: string | null ) => void;
5838

5939
/**
6040
* Interface for resolving a path by walking parent directories.

lib/node_modules/@stdlib/fs/resolve-parent-path/docs/types/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import resolveParentPath = require( './index' );
2020

21-
const done = ( error: Error, path: string | null ) => {
21+
const done = ( error: Error | null, path: string | null ) => {
2222
if ( error || path === null ) {
2323
throw error;
2424
}
@@ -30,7 +30,6 @@ const done = ( error: Error, path: string | null ) => {
3030
// The function does not have a return value...
3131
{
3232
resolveParentPath( 'package.json', done ); // $ExpectType void
33-
resolveParentPath.sync( 'package.json' ); // $ExpectType string | null
3433
}
3534

3635
// The compiler throws an error if the function is provided a first argument which is not a string...

0 commit comments

Comments
 (0)