Skip to content

Commit

Permalink
chore: minor clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
Planeshifter committed Sep 26, 2024
1 parent efce610 commit 7b02c16
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 25 deletions.
5 changes: 2 additions & 3 deletions lib/node_modules/@stdlib/array/base/cusome/lib/assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function indexed( x, n, y, stride, offset ) {
}

/**
* Cumulatively tests whether at least `n` array elements in accessor array are truthy.
* Cumulatively tests whether at least `n` array elements in an accessor array are truthy.
*
* @private
* @param {Object} x - input array object
Expand Down Expand Up @@ -128,15 +128,14 @@ function accessors( x, n, y, stride, offset ) {
flg = true;
}
}

yset( ydata, io, flg );
io += stride;
}
return ydata;
}

/**
* Cumulatively tests whether at least `n` array elements in a provided complex number are truthy and assigns results to provided output array.
* Cumulatively tests whether at least `n` array elements in a provided complex number array are truthy.
*
* @private
* @param {Collection} x - array containing interleaved real and imaginary components
Expand Down
14 changes: 5 additions & 9 deletions lib/node_modules/@stdlib/array/base/cusome/test/test.assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
* limitations under the License.
*/

/* eslint-disable max-len */

'use strict';

// MODULES //
Expand Down Expand Up @@ -166,9 +168,7 @@ tape( 'the function cumulatively tests whether at least `n` array elements are t
y = [ false, null, false, null, false, null, false, null, false, null ];

actual = cusome( x, 2, y, 2, 0 );
expected = [
false, null, false, null, false, null, false, null, false, null
];
expected = [ false, null, false, null, false, null, false, null, false, null ];

t.strictEqual( actual, y, 'returns expected value' );
t.deepEqual( actual, expected, 'returns expected value' );
Expand Down Expand Up @@ -209,9 +209,7 @@ tape( 'the function cumulatively tests whether at least `n` array elements are t
var x;
var y;

x = new Complex128Array([
1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0
]);
x = new Complex128Array([ 1.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 0.0, 1.0 ]);
y = [ false, true, false, true, false ];

actual = cusome( x, 1, y, 1, 0 );
Expand All @@ -220,9 +218,7 @@ tape( 'the function cumulatively tests whether at least `n` array elements are t
t.strictEqual( actual, y, 'returns expected value' );
t.deepEqual( actual, expected, 'returns expected value' );

x = new Complex128Array([
0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0
]);
x = new Complex128Array([ 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0 ]);
y = [ false, null, false, null, false, null, false, null, false, null ];

actual = cusome( x, 2, y, 2, 0 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import fmtprodmsgFactory = require( './index' );

// TESTS //

// The function returns an returns an error formatting function...
// The function returns an error formatting function...
{
fmtprodmsgFactory( {} ); // $ExpectType FormatProdErrorMsgFunction
}
Expand All @@ -42,7 +42,7 @@ import fmtprodmsgFactory = require( './index' );
fcn( '3', 'wrong_type' ); // $ExpectType string
}

// The compiler throws an error if the function is provided an `url` option which is not a string...
// The compiler throws an error if the function is provided a `url` option which is not a string...
{
fmtprodmsgFactory( { 'url': true } ); // $ExpectError
fmtprodmsgFactory( { 'url': false } ); // $ExpectError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import fmtprodmsg = require( './index' );

// TESTS //

// The function returns an string...
// The function returns a string...
{
fmtprodmsg( '1' ); // $ExpectType string
fmtprodmsg( '3', 'wrong_type' ); // $ExpectType string
Expand Down
18 changes: 9 additions & 9 deletions lib/node_modules/@stdlib/fs/rename/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import rename = require( './index' );

const done = ( error: Error | null ) => {
const done = ( error: Error | null ): void => {
if ( error ) {
throw error;
}
Expand Down Expand Up @@ -94,14 +94,14 @@ const done = ( error: Error | null ) => {

// The compiler throws an error if the `sync` method is provided a second argument which is not a string...
{
rename.sync( './beep/boop.txt', 1, ); // $ExpectError
rename.sync( './beep/boop.txt', false, ); // $ExpectError
rename.sync( './beep/boop.txt', true, ); // $ExpectError
rename.sync( './beep/boop.txt', null, ); // $ExpectError
rename.sync( './beep/boop.txt', undefined, ); // $ExpectError
rename.sync( './beep/boop.txt', [], ); // $ExpectError
rename.sync( './beep/boop.txt', {}, ); // $ExpectError
rename.sync( './beep/boop.txt', ( x: number ): number => x, ); // $ExpectError
rename.sync( './beep/boop.txt', 1 ); // $ExpectError
rename.sync( './beep/boop.txt', false ); // $ExpectError
rename.sync( './beep/boop.txt', true ); // $ExpectError
rename.sync( './beep/boop.txt', null ); // $ExpectError
rename.sync( './beep/boop.txt', undefined ); // $ExpectError
rename.sync( './beep/boop.txt', [] ); // $ExpectError
rename.sync( './beep/boop.txt', {} ); // $ExpectError
rename.sync( './beep/boop.txt', ( x: number ): number => x ); // $ExpectError
}

// The compiler throws an error if the `sync` method is provided an unsupported number of arguments...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import sliceShape = require( './index' );

// TESTS //

// The function returns a number...
// The function returns an array of numbers...
{
sliceShape( new MultiSlice( null, null ) ); // $ExpectType number[]
sliceShape( new MultiSlice( null, null, null ) ); // $ExpectType number[]
Expand Down

1 comment on commit 7b02c16

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
array/base/cusome $\color{green}416/416$
$\color{green}+100.00\%$
$\color{green}36/36$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}416/416$
$\color{green}+100.00\%$
error/tools/fmtprodmsg-factory $\color{green}225/225$
$\color{green}+100.00\%$
$\color{green}19/19$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}225/225$
$\color{green}+100.00\%$
error/tools/fmtprodmsg $\color{red}86/88$
$\color{green}+97.73\%$
$\color{red}3/4$
$\color{green}+75.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{red}86/88$
$\color{green}+97.73\%$
fs/rename $\color{green}164/164$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}2/2$
$\color{green}+100.00\%$
$\color{green}164/164$
$\color{green}+100.00\%$
slice/base/shape $\color{green}149/149$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}1/1$
$\color{green}+100.00\%$
$\color{green}149/149$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.