diff --git a/lib/node_modules/@stdlib/utils/circular-buffer/docs/types/test.ts b/lib/node_modules/@stdlib/utils/circular-buffer/docs/types/test.ts index a5f1f9a0feff..bf7827cd7b82 100644 --- a/lib/node_modules/@stdlib/utils/circular-buffer/docs/types/test.ts +++ b/lib/node_modules/@stdlib/utils/circular-buffer/docs/types/test.ts @@ -29,6 +29,9 @@ import CircularBuffer = require( './index' ); // The function returns a circular buffer instance... { new CircularBuffer( 3 ); // $ExpectType CircularBuffer + new CircularBuffer( [ 1, 2, 3 ] ); // $ExpectType CircularBuffer + new CircularBuffer( 'abc' ); // $ExpectType CircularBuffer + new CircularBuffer( { 'length': 10 } ); // $ExpectType CircularBuffer } // The compiler throws an error if the constructor function is provided an invalid number of arguments... @@ -36,3 +39,13 @@ import CircularBuffer = require( './index' ); new CircularBuffer(); // $ExpectError new CircularBuffer( 3, 4 ); // $ExpectError } + +// The compiler throws an error if the constructor function is provided a first argument which is not a number or an array-like object... +{ + new CircularBuffer( true ); // $ExpectError + new CircularBuffer( false ); // $ExpectError + new CircularBuffer( null ); // $ExpectError + new CircularBuffer( undefined ); // $ExpectError + new CircularBuffer( {} ); // $ExpectError + new CircularBuffer( ( x: number ): number => x ); // $ExpectError +}