Skip to content

Commit ca92444

Browse files
committed
Update declaration file and tests
1 parent c14d59d commit ca92444

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

lib/node_modules/@stdlib/assert/is-boolean/docs/types/index.d.ts

+29-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* Interface defining `isBoolean` with methods for testing for primitives and objects, respectively.
2323
*/
24-
interface Main {
24+
interface IsBoolean {
2525
/**
2626
* Tests if a value is a boolean.
2727
*
@@ -53,15 +53,15 @@ interface Main {
5353
* @returns boolean indicating if a value is a boolean primitive
5454
*
5555
* @example
56-
* var bool = isBoolean( true );
56+
* var bool = isBoolean.isPrimitive( true );
5757
* // returns true
5858
*
5959
* @example
60-
* var bool = isBoolean( false );
60+
* var bool = isBoolean.isPrimitive( false );
6161
* // returns true
6262
*
6363
* @example
64-
* var bool = isBoolean( new Boolean( true ) );
64+
* var bool = isBoolean.isPrimitive( new Boolean( true ) );
6565
* // returns false
6666
*/
6767
isPrimitive( value: any ): boolean;
@@ -73,17 +73,39 @@ interface Main {
7373
* @returns boolean indicating if a value is a boolean object
7474
*
7575
* @example
76-
* var bool = isBoolean( true );
76+
* var bool = isBoolean.isObject( true );
7777
* // returns false
7878
*
7979
* @example
80-
* var bool = isBoolean( new Boolean( false ) );
80+
* var bool = isBoolean.isObject( new Boolean( false ) );
8181
* // returns true
8282
*/
8383
isObject( value: any ): boolean;
8484
}
8585

86-
declare var isBoolean: Main;
86+
/**
87+
* Tests if a value is a boolean.
88+
*
89+
* @param value - value to test
90+
* @returns boolean indicating whether value is a boolean
91+
*
92+
* @example
93+
* var bool = isBoolean( false );
94+
* // returns true
95+
*
96+
* @example
97+
* var bool = isBoolean( true );
98+
* // returns true
99+
*
100+
* @example
101+
* var bool = isBoolean( new Boolean( false ) );
102+
* // returns true
103+
*
104+
* @example
105+
* var bool = isBoolean( new Boolean( true ) );
106+
* // returns true
107+
*/
108+
declare var isBoolean: IsBoolean;
87109

88110

89111
// EXPORTS //

lib/node_modules/@stdlib/assert/is-boolean/docs/types/test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,28 +33,28 @@ import isBoolean = require( './index' );
3333
isBoolean( true, 123 ); // $ExpectError
3434
}
3535

36-
// The function has an `isPrimitive` method for testing primitives...
36+
// Attached to main export is an isPrimitive method which returns a boolean...
3737
{
3838
// tslint:disable-next-line:no-construct
3939
isBoolean.isPrimitive( new Boolean( true ) ); // $ExpectType boolean
4040
isBoolean.isPrimitive( true ); // $ExpectType boolean
4141
}
4242

43-
// The compiler throws an error if the `isPrimitive` method is provided an unsupported number of arguments...
43+
// The compiler throws an error if the isPrimitive method is provided an unsupported number of arguments...
4444
{
4545
isBoolean.isPrimitive(); // $ExpectError
4646
isBoolean.isPrimitive( true, 123 ); // $ExpectError
4747
}
4848

4949

50-
// The function has an `isObject` method for testing objects...
50+
// Attached to main export is an isPrimitive method which returns a boolean...
5151
{
5252
// tslint:disable-next-line:no-construct
5353
isBoolean.isObject( new Boolean( true ) ); // $ExpectType boolean
5454
isBoolean.isObject( true ); // $ExpectType boolean
5555
}
5656

57-
// The compiler throws an error if the `isObject` method is provided an unsupported number of arguments...
57+
// The compiler throws an error if the isObject method is provided an unsupported number of arguments...
5858
{
5959
isBoolean.isObject(); // $ExpectError
6060
isBoolean.isObject( true, 123 ); // $ExpectError

0 commit comments

Comments
 (0)