Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ type InOutShapes = [ Array<number>, Array<number>, Array<number>, Array<number>,
const shapes: InOutShapes = [ [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ] ];

bquinary4d( [ x, y, z, w, v, out ], shapes, fcn ); // $ExpectType void
bquinary4d( [ x[ 0 ], y, z, w, v, out ], [ [ shapes[ 0 ][ 1 ][ 2 ][ 3 ] ], shapes[ 1 ], shapes[ 2 ], shapes [ 3 ], shapes[ 4 ], shapes[ 5 ] ] , fcn ); // $ExpectType void
bquinary4d( [ x[ 0 ], y, z, w, v, out ], [ [ shapes[ 0 ][ 1 ][ 2 ][ 3 ] ], shapes[ 1 ], shapes[ 2 ], shapes [ 3 ], shapes[ 4 ], shapes[ 5 ] ], fcn ); // $ExpectType void
}

// The compiler throws an error if the function is provided a first argument which is not an array of nested arrays...
{
const shapes: InOutShapes = [ [ 2, 2, 2, 2 ] , [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ] ];
const shapes: InOutShapes = [ [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ] ];

bquinary4d( 'abc', shapes, fcn ); // $ExpectError
bquinary4d( 3.14, shapes, fcn ); // $ExpectError
Expand Down Expand Up @@ -97,7 +97,7 @@ type InOutShapes = [ Array<number>, Array<number>, Array<number>, Array<number>,
const v = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ];
const out = [ [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ] ];

const shapes: InOutShapes = [ [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2 ,2 ] ];
const shapes: InOutShapes = [ [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ] ];

bquinary4d( [ x, y, z, w, v, out ], shapes, 'abc' ); // $ExpectError
bquinary4d( [ x, y, z, w, v, out ], shapes, 3.14 ); // $ExpectError
Expand All @@ -117,7 +117,7 @@ type InOutShapes = [ Array<number>, Array<number>, Array<number>, Array<number>,
const v = [ [ [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ] ];
const out = [ [ [ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ] ] ];

const shapes: InOutShapes = [ [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2 ,2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ] ];
const shapes: InOutShapes = [ [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ], [ 2, 2, 2, 2 ] ];

bquinary4d(); // $ExpectError
bquinary4d( [ x, y, z, w, v, out ] ); // $ExpectError
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/string/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1006,11 +1006,11 @@ interface Namespace {
* // returns 'Hello World!'
*
* @example
* var out = ns.replaceAfter( 'beep boop', ' ', 'foo' , 5 );
* var out = ns.replaceAfter( 'beep boop', ' ', 'foo', 5 );
* // returns 'beep boop'
*
* @example
* var out = ns.replaceAfter( 'beep boop beep baz', 'beep', 'foo' , 5 );
* var out = ns.replaceAfter( 'beep boop beep baz', 'beep', 'foo', 5 );
* // returns 'beep boop beepfoo'
*/
replaceAfter: typeof replaceAfter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ import replaceAfterLast = require( './index' );
// The compiler throws an error if the function is provided arguments having invalid types...
{
replaceAfterLast( true, 'd', 'foo', 100 ); // $ExpectError
replaceAfterLast( false, 'd' , 'foo', 100 ); // $ExpectError
replaceAfterLast( 3, 'd' , 'foo', 100 ); // $ExpectError
replaceAfterLast( [], 'd' , 'foo', 100 ); // $ExpectError
replaceAfterLast( {}, 'd' , 'foo', 100 ); // $ExpectError
replaceAfterLast( false, 'd', 'foo', 100 ); // $ExpectError
replaceAfterLast( 3, 'd', 'foo', 100 ); // $ExpectError
replaceAfterLast( [], 'd', 'foo', 100 ); // $ExpectError
replaceAfterLast( {}, 'd', 'foo', 100 ); // $ExpectError
replaceAfterLast( ( x: number ): number => x, 'd', 'foo', 100 ); // $ExpectError

replaceAfterLast( 'abc', true, 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', false, 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', 5 , 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', 5, 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', [], 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', {} , 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', ( x: number ): number => x , 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', {}, 'foo', 10 ); // $ExpectError
replaceAfterLast( 'abc', ( x: number ): number => x, 'foo', 10 ); // $ExpectError

replaceAfterLast( 'abc', 'd', true, 10 ); // $ExpectError
replaceAfterLast( 'abc', 'd', false, 10 ); // $ExpectError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@
* // returns 'Hello World!'
*
* @example
* var out = replaceAfter( 'beep boop', ' ', 'foo' , 5 );
* var out = replaceAfter( 'beep boop', ' ', 'foo', 5 );
* // returns 'beep boop'
*
* @example
* var out = replaceAfter( 'beep boop beep baz', 'beep', 'foo' , 5 );
* var out = replaceAfter( 'beep boop beep baz', 'beep', 'foo', 5 );
* // returns 'beep boop beepfoo'
*/
declare function replaceAfter( str: string, search: string, replacement: string, fromIndex: number ): string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ import replaceAfter = require( './index' );
// The compiler throws an error if the function is provided arguments having invalid types...
{
replaceAfter( true, 'd', 'foo', 0 ); // $ExpectError
replaceAfter( false, 'd' , 'foo', 0 ); // $ExpectError
replaceAfter( 3, 'd' , 'foo', 0 ); // $ExpectError
replaceAfter( [], 'd' , 'foo', 0 ); // $ExpectError
replaceAfter( {}, 'd' , 'foo', 0 ); // $ExpectError
replaceAfter( false, 'd', 'foo', 0 ); // $ExpectError
replaceAfter( 3, 'd', 'foo', 0 ); // $ExpectError
replaceAfter( [], 'd', 'foo', 0 ); // $ExpectError
replaceAfter( {}, 'd', 'foo', 0 ); // $ExpectError
replaceAfter( ( x: number ): number => x, 'd', 'foo', 0 ); // $ExpectError

replaceAfter( 'abc', true, 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', false, 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', 5 , 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', 5, 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', [], 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', {} , 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', ( x: number ): number => x , 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', {}, 'foo', 0 ); // $ExpectError
replaceAfter( 'abc', ( x: number ): number => x, 'foo', 0 ); // $ExpectError

replaceAfter( 'abc', 'd', true, 0 ); // $ExpectError
replaceAfter( 'abc', 'd', false, 0 ); // $ExpectError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ import replaceBeforeLast = require( './index' );
// The compiler throws an error if the function is provided arguments having invalid types...
{
replaceBeforeLast( true, 'd', 'foo', 100 ); // $ExpectError
replaceBeforeLast( false, 'd' , 'foo', 100 ); // $ExpectError
replaceBeforeLast( 3, 'd' , 'foo', 100 ); // $ExpectError
replaceBeforeLast( [], 'd' , 'foo', 100 ); // $ExpectError
replaceBeforeLast( {}, 'd' , 'foo', 100 ); // $ExpectError
replaceBeforeLast( false, 'd', 'foo', 100 ); // $ExpectError
replaceBeforeLast( 3, 'd', 'foo', 100 ); // $ExpectError
replaceBeforeLast( [], 'd', 'foo', 100 ); // $ExpectError
replaceBeforeLast( {}, 'd', 'foo', 100 ); // $ExpectError
replaceBeforeLast( ( x: number ): number => x, 'd', 'foo', 100 ); // $ExpectError

replaceBeforeLast( 'abc', true, 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', false, 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', 5 , 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', 5, 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', [], 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', {} , 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', ( x: number ): number => x , 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', {}, 'foo', 10 ); // $ExpectError
replaceBeforeLast( 'abc', ( x: number ): number => x, 'foo', 10 ); // $ExpectError

replaceBeforeLast( 'abc', 'd', true, 10 ); // $ExpectError
replaceBeforeLast( 'abc', 'd', false, 10 ); // $ExpectError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ import replaceBefore = require( './index' );
// The compiler throws an error if the function is provided arguments having invalid types...
{
replaceBefore( true, 'd', 'foo', 0 ); // $ExpectError
replaceBefore( false, 'd' , 'foo', 0 ); // $ExpectError
replaceBefore( 3, 'd' , 'foo', 0 ); // $ExpectError
replaceBefore( [], 'd' , 'foo', 0 ); // $ExpectError
replaceBefore( {}, 'd' , 'foo', 0 ); // $ExpectError
replaceBefore( false, 'd', 'foo', 0 ); // $ExpectError
replaceBefore( 3, 'd', 'foo', 0 ); // $ExpectError
replaceBefore( [], 'd', 'foo', 0 ); // $ExpectError
replaceBefore( {}, 'd', 'foo', 0 ); // $ExpectError
replaceBefore( ( x: number ): number => x, 'd', 'foo', 0 ); // $ExpectError

replaceBefore( 'abc', true, 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', false, 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', 5 , 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', 5, 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', [], 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', {} , 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', ( x: number ): number => x , 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', {}, 'foo', 0 ); // $ExpectError
replaceBefore( 'abc', ( x: number ): number => x, 'foo', 0 ); // $ExpectError

replaceBefore( 'abc', 'd', true, 0 ); // $ExpectError
replaceBefore( 'abc', 'd', false, 0 ); // $ExpectError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ import replaceBefore = require( './index' );
// The compiler throws an error if the function is provided arguments having invalid types...
{
replaceBefore( true, 'd', 'foo' ); // $ExpectError
replaceBefore( false, 'd' , 'foo' ); // $ExpectError
replaceBefore( 3, 'd' , 'foo' ); // $ExpectError
replaceBefore( [], 'd' , 'foo' ); // $ExpectError
replaceBefore( {}, 'd' , 'foo' ); // $ExpectError
replaceBefore( false, 'd', 'foo' ); // $ExpectError
replaceBefore( 3, 'd', 'foo' ); // $ExpectError
replaceBefore( [], 'd', 'foo' ); // $ExpectError
replaceBefore( {}, 'd', 'foo' ); // $ExpectError
replaceBefore( ( x: number ): number => x, 'd', 'foo' ); // $ExpectError

replaceBefore( 'abc', true, 'foo' ); // $ExpectError
replaceBefore( 'abc', false, 'foo' ); // $ExpectError
replaceBefore( 'abc', 5 , 'foo' ); // $ExpectError
replaceBefore( 'abc', 5, 'foo' ); // $ExpectError
replaceBefore( 'abc', [], 'foo' ); // $ExpectError
replaceBefore( 'abc', {} , 'foo' ); // $ExpectError
replaceBefore( 'abc', ( x: number ): number => x , 'foo' ); // $ExpectError
replaceBefore( 'abc', {}, 'foo' ); // $ExpectError
replaceBefore( 'abc', ( x: number ): number => x, 'foo' ); // $ExpectError

replaceBefore( 'abc', 'd', true ); // $ExpectError
replaceBefore( 'abc', 'd', false ); // $ExpectError
Expand Down
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/utils/pop/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ bench( format( '%s::array', pkg ), function benchmark( b ) {
var i;

len = b.iterations;
arr = new Array( len );
arr = [];
for ( i = 0; i < len; i++ ) {
arr[ i ] = i;
arr.push( i );
}
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
Expand All @@ -62,9 +62,9 @@ bench( format( '%s::built-in', pkg ), function benchmark( b ) {
var i;

len = b.iterations;
arr = new Array( len );
arr = [];
for ( i = 0; i < len; i++ ) {
arr[ i ] = i;
arr.push( i );
}
b.tic();
for ( i = 0; i < b.iterations; i++ ) {
Expand Down