Skip to content

Commit 4dba8a6

Browse files
chore: fix JavaScript lint errors
PR-URL: #8134 Closes: #8129 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]>
1 parent ae2b673 commit 4dba8a6

File tree

3 files changed

+53
-47
lines changed

3 files changed

+53
-47
lines changed

lib/node_modules/@stdlib/_tools/github/create-repo/lib/factory.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,21 +95,22 @@ function factory( options, clbk ) {
9595
throw new TypeError( format( 'invalid argument. Repository name must be a string. Value: `%s`.', name ) );
9696
}
9797
query( name, opts, done );
98-
/**
99-
* Callback invoked after receiving an API response.
100-
*
101-
* @private
102-
* @param {(Error|null)} error - error object
103-
* @param {ObjectArray} data - query data
104-
* @param {Object} info - response info
105-
* @returns {void}
106-
*/
107-
function done( error, data, info ) {
108-
error = error || null;
109-
data = data || null;
110-
info = info || null;
111-
clbk( error, data, info );
112-
}
98+
}
99+
100+
/**
101+
* Callback invoked after receiving an API response.
102+
*
103+
* @private
104+
* @param {(Error|null)} error - error object
105+
* @param {ObjectArray} data - query data
106+
* @param {Object} info - response info
107+
* @returns {void}
108+
*/
109+
function done( error, data, info ) {
110+
error = error || null;
111+
data = data || null;
112+
info = info || null;
113+
clbk( error, data, info );
113114
}
114115
}
115116

lib/node_modules/@stdlib/assert/is-method/examples/index.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,25 @@
1616
* limitations under the License.
1717
*/
1818

19-
/* eslint-disable object-curly-newline */
20-
2119
'use strict';
2220

2321
var isMethod = require( './../lib' );
2422

25-
var bool = isMethod( { 'a': isMethod }, 'a' );
23+
var obj = {
24+
'a': isMethod
25+
};
26+
var bool = isMethod( obj, 'a' );
2627
console.log( bool );
2728
// => true
2829

29-
bool = isMethod( { 'a': 'b' }, 'a' );
30+
obj = {
31+
'a': 'b'
32+
};
33+
bool = isMethod( obj, 'a' );
3034
console.log( bool );
3135
// => false
3236

33-
bool = isMethod( { 'a': 'b' }, null );
37+
bool = isMethod( obj, null );
3438
console.log( bool );
3539
// => false
3640

@@ -46,10 +50,16 @@ bool = isMethod( void 0, 'a' );
4650
console.log( bool );
4751
// => false
4852

49-
bool = isMethod( { 'null': isMethod }, null );
53+
obj = {
54+
'null': isMethod
55+
};
56+
bool = isMethod( obj, null );
5057
console.log( bool );
5158
// => true
5259

53-
bool = isMethod( { '[object Object]': isMethod }, {} );
60+
obj = {
61+
'[object Object]': isMethod
62+
};
63+
bool = isMethod( obj, {} );
5464
console.log( bool );
5565
// => true

lib/node_modules/@stdlib/ndarray/base/shape2strides/benchmark/benchmark.js

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench' );
24-
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
25-
var randu = require( '@stdlib/random/base/randu' );
26-
var floor = require( '@stdlib/math/base/special/floor' );
24+
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
25+
var zeros = require( '@stdlib/array/base/zeros' );
2726
var isArray = require( '@stdlib/assert/is-array' );
2827
var pkg = require( './../package.json' ).name;
2928
var shape2strides = require( './../lib' );
@@ -36,14 +35,13 @@ bench( pkg+':order=row-major', function benchmark( b ) {
3635
var out;
3736
var i;
3837

39-
shape = [ 0, 0, 0 ];
40-
shape[ 0 ] = discreteUniform( 0, 10 );
41-
shape[ 1 ] = discreteUniform( 0, 10 );
42-
shape[ 2 ] = discreteUniform( 0, 10 );
38+
shape = discreteUniform( 3, 0, 10, {
39+
'dtype': 'generic'
40+
});
4341

4442
b.tic();
4543
for ( i = 0; i < b.iterations; i++ ) {
46-
shape[ 0 ] = floor( randu()*10 );
44+
shape[ 0 ] += 1;
4745
out = shape2strides( shape, 'row-major' );
4846
if ( out.length !== shape.length ) {
4947
b.fail( 'should have expected length' );
@@ -62,14 +60,13 @@ bench( pkg+':order=column-major', function benchmark( b ) {
6260
var out;
6361
var i;
6462

65-
shape = [ 0, 0, 0 ];
66-
shape[ 0 ] = floor( randu()*10 );
67-
shape[ 1 ] = floor( randu()*10 );
68-
shape[ 2 ] = floor( randu()*10 );
63+
shape = discreteUniform( 3, 0, 10, {
64+
'dtype': 'generic'
65+
});
6966

7067
b.tic();
7168
for ( i = 0; i < b.iterations; i++ ) {
72-
shape[ 0 ] = floor( randu()*10 );
69+
shape[ 0 ] += 1;
7370
out = shape2strides( shape, 'column-major' );
7471
if ( out.length !== shape.length ) {
7572
b.fail( 'should have expected length' );
@@ -88,16 +85,15 @@ bench( pkg+':assign:order=row-major', function benchmark( b ) {
8885
var out;
8986
var i;
9087

91-
shape = [ 0, 0, 0 ];
92-
shape[ 0 ] = floor( randu()*10 );
93-
shape[ 1 ] = floor( randu()*10 );
94-
shape[ 2 ] = floor( randu()*10 );
88+
shape = discreteUniform( 3, 0, 10, {
89+
'dtype': 'generic'
90+
});
9591

96-
out = new Array( shape.length );
92+
out = zeros( shape.length );
9793

9894
b.tic();
9995
for ( i = 0; i < b.iterations; i++ ) {
100-
shape[ 0 ] = floor( randu()*10 );
96+
shape[ 0 ] += 1;
10197
out = shape2strides.assign( shape, 'row-major', out );
10298
if ( out.length !== shape.length ) {
10399
b.fail( 'should have expected length' );
@@ -116,16 +112,15 @@ bench( pkg+':assign:order=column-major', function benchmark( b ) {
116112
var out;
117113
var i;
118114

119-
shape = [ 0, 0, 0 ];
120-
shape[ 0 ] = floor( randu()*10 );
121-
shape[ 1 ] = floor( randu()*10 );
122-
shape[ 2 ] = floor( randu()*10 );
115+
shape = discreteUniform( 3, 0, 10, {
116+
'dtype': 'generic'
117+
});
123118

124-
out = new Array( shape.length );
119+
out = zeros( shape.length );
125120

126121
b.tic();
127122
for ( i = 0; i < b.iterations; i++ ) {
128-
shape[ 0 ] = floor( randu()*10 );
123+
shape[ 0 ] += 1;
129124
out = shape2strides.assign( shape, 'column-major', out );
130125
if ( out.length !== shape.length ) {
131126
b.fail( 'should have expected length' );

0 commit comments

Comments
 (0)