Skip to content

Commit a276b04

Browse files
committed
feat(lint): corrected linting for new package tinymt32
1 parent 9f58cf4 commit a276b04

File tree

21 files changed

+1170
-1171
lines changed

21 files changed

+1170
-1171
lines changed

lib/node_modules/@stdlib/random/base/tinymt32/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ var rand = tinymt32.factory({
7070
});
7171

7272
var r = rand();
73-
// returns <number> (to do)
73+
// returns 2682965004
7474
```
7575

7676
or, for arbitrary length seeds, an array-like object containing unsigned 32-bit integers
@@ -83,7 +83,7 @@ var rand = tinymt32.factory({
8383
});
8484

8585
var r = rand();
86-
// returns <number> (to do)
86+
// returns 3008825266
8787
```
8888

8989
To return a generator having a specific initial state, set the generator `state` option.
Lines changed: 62 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
88
* You may obtain a copy of the License at
99
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* http://www.apache.org/licenses/LICENSE-2.0
1111
*
1212
* Unless required by applicable law or agreed to in writing, software
1313
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,68 +29,72 @@ var tinymt32 = require( './../lib' );
2929
// MAIN //
3030

3131
bench( pkg+'::factory', function benchmark( b ) {
32-
var prng;
33-
var z;
34-
var i;
32+
var prng;
33+
var z;
34+
var i;
3535

36-
b.tic();
37-
for ( i = 0; i < b.iterations; i++ ) {
38-
prng = tinymt32.factory();
39-
z = prng();
40-
if ( isnan( z ) ) {
41-
b.fail( 'should not return NaN' );
42-
}
43-
}
44-
b.toc();
45-
if ( isnan( z ) ) {
46-
b.fail( 'should not return NaN' );
47-
}
48-
b.pass( 'benchmark finished' );
49-
b.end();
36+
b.tic();
37+
for ( i = 0; i < b.iterations; i++ ) {
38+
prng = tinymt32.factory();
39+
z = prng();
40+
if ( isnan( z ) ) {
41+
b.fail( 'should not return NaN' );
42+
}
43+
}
44+
b.toc();
45+
if ( isnan( z ) ) {
46+
b.fail( 'should not return NaN' );
47+
}
48+
b.pass( 'benchmark finished' );
49+
b.end();
5050
});
5151

5252
bench( pkg+'::factory,normalized', function benchmark( b ) {
53-
var prng;
54-
var z;
55-
var i;
53+
var prng;
54+
var z;
55+
var i;
5656

57-
b.tic();
58-
for ( i = 0; i < b.iterations; i++ ) {
59-
prng = tinymt32.factory({
60-
'normalized': true
61-
});
62-
z = prng();
63-
if ( isnan( z ) ) {
64-
b.fail( 'should not return NaN' );
65-
}
66-
}
67-
b.toc();
68-
if ( isnan( z ) ) {
69-
b.fail( 'should not return NaN' );
70-
}
71-
b.pass( 'benchmark finished' );
72-
b.end();
57+
b.tic();
58+
for ( i = 0; i < b.iterations; i++ ) {
59+
prng = tinymt32.factory({
60+
'normalized': true
61+
});
62+
z = prng();
63+
if ( isnan( z ) ) {
64+
b.fail( 'should not return NaN' );
65+
}
66+
}
67+
b.toc();
68+
if ( isnan( z ) ) {
69+
b.fail( 'should not return NaN' );
70+
}
71+
b.pass( 'benchmark finished' );
72+
b.end();
7373
});
7474

7575
bench( pkg+'::factory,seed=<integer>', function benchmark( b ) {
76-
var prng;
77-
var z;
78-
var i;
76+
var opts;
77+
var prng;
78+
var z;
79+
var i;
7980

80-
b.tic();
81-
for ( i = 0; i < b.iterations; i++ ) {
82-
prng = tinymt32.factory({
83-
'seed': i
84-
});
85-
z = prng();
86-
if ( isnan( z ) ) {
87-
b.fail( 'should not return NaN' );
88-
}
89-
}
90-
b.toc();
91-
if ( isnan( z ) ) {
92-
b.fail( 'should not return NaN' );
93-
}
94-
b.pass( 'benchmark finished' );
95-
b.end();
96-
});
81+
opts = {
82+
'seed': 1
83+
};
84+
85+
b.tic();
86+
for ( i = 0; i < b.iterations; i++ ) {
87+
opts.seed += 1;
88+
prng = tinymt32.factory(opts);
89+
z = prng();
90+
if ( isnan( z ) ) {
91+
b.fail( 'should not return NaN' );
92+
}
93+
}
94+
b.toc();
95+
if ( isnan( z ) ) {
96+
b.fail( 'should not return NaN' );
97+
}
98+
b.pass( 'benchmark finished' );
99+
b.end();
100+
});
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
88
* You may obtain a copy of the License at
99
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
10+
* http://www.apache.org/licenses/LICENSE-2.0
1111
*
1212
* Unless required by applicable law or agreed to in writing, software
1313
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,20 +29,20 @@ var tinymt32 = require( './../lib' );
2929
// MAIN //
3030

3131
bench( pkg, function benchmark( b ) {
32-
var z;
33-
var i;
32+
var z;
33+
var i;
3434

35-
b.tic();
36-
for ( i = 0; i < b.iterations; i++ ) {
37-
z = tinymt32();
38-
if ( isnan( z ) ) {
39-
b.fail( 'should not return NaN' );
40-
}
41-
}
42-
b.toc();
43-
if ( isnan( z ) ) {
44-
b.fail( 'should not return NaN' );
45-
}
46-
b.pass( 'benchmark finished' );
47-
b.end();
48-
});
35+
b.tic();
36+
for ( i = 0; i < b.iterations; i++ ) {
37+
z = tinymt32();
38+
if ( isnan( z ) ) {
39+
b.fail( 'should not return NaN' );
40+
}
41+
}
42+
b.toc();
43+
if ( isnan( z ) ) {
44+
b.fail( 'should not return NaN' );
45+
}
46+
b.pass( 'benchmark finished' );
47+
b.end();
48+
});

lib/node_modules/@stdlib/random/base/tinymt32/benchmark/benchmark.to_json.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -28,20 +28,20 @@ var tinymt32 = require( './../lib' );
2828
// MAIN //
2929

3030
bench( pkg+'::to_json', function benchmark( b ) {
31-
var o;
32-
var i;
31+
var o;
32+
var i;
3333

34-
b.tic();
35-
for ( i = 0; i < b.iterations; i++ ) {
36-
o = tinymt32.toJSON();
37-
if ( typeof o !== 'object' ) {
38-
b.fail( 'should return an object' );
39-
}
40-
}
41-
b.toc();
42-
if ( typeof o !== 'object' ) {
43-
b.fail( 'should return an object' );
44-
}
45-
b.pass( 'benchmark finished' );
46-
b.end();
47-
});
34+
b.tic();
35+
for ( i = 0; i < b.iterations; i++ ) {
36+
o = tinymt32.toJSON();
37+
if ( typeof o !== 'object' ) {
38+
b.fail( 'should return an object' );
39+
}
40+
}
41+
b.toc();
42+
if ( typeof o !== 'object' ) {
43+
b.fail( 'should return an object' );
44+
}
45+
b.pass( 'benchmark finished' );
46+
b.end();
47+
});

lib/node_modules/@stdlib/random/base/tinymt32/benchmark/c/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#/
22
# @license Apache-2.0
33
#
4-
# Copyright (c) 2024 The Stdlib Authors.
4+
# Copyright (c) 2025 The Stdlib Authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -143,4 +143,4 @@ run: $(c_targets)
143143
clean:
144144
$(QUIET) -rm -f *.o *.out
145145

146-
.PHONY: clean
146+
.PHONY: clean

lib/node_modules/@stdlib/random/base/tinymt32/benchmark/c/benchmark.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
/**
2020
* Benchmark `tinymt32`.
2121
*/
22+
#include "stdlib/random/base/tinymt32.h"
2223
#include <stdlib.h>
2324
#include <stdio.h>
2425
#include <stdint.h>
@@ -160,4 +161,4 @@ int main( void ) {
160161
print_summary( REPEATS, REPEATS );
161162

162163
return 0;
163-
}
164+
}

lib/node_modules/@stdlib/random/base/tinymt32/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -179,4 +179,4 @@ declare var tinymt32: Random;
179179

180180
// EXPORTS //
181181

182-
export = tinymt32;
182+
export = tinymt32;

lib/node_modules/@stdlib/random/base/tinymt32/examples/c/example.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -74,4 +74,4 @@ int main( void ) {
7474
}
7575

7676
stdlib_base_random_tinymt32_free( obj );
77-
}
77+
}

lib/node_modules/@stdlib/random/base/tinymt32/examples/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ var tinymt32 = require( './../lib' );
2424
console.log( '\nseed: %d', tinymt32.seed[ 0 ] );
2525
var i;
2626
for ( i = 0; i < 100; i++ ) {
27-
console.log( tinymt32() );
27+
console.log( tinymt32() );
2828
}
2929

3030
// Create a new pseudorandom number generator...
3131
var seed = 1234;
3232
var rand = tinymt32.factory({
33-
'seed': seed
33+
'seed': seed
3434
});
3535
console.log( '\nseed: %d', seed );
3636
for ( i = 0; i < 100; i++ ) {
37-
console.log( rand() );
37+
console.log( rand() );
3838
}
3939

4040
// Create another pseudorandom number generator using a previous seed...
4141
rand = tinymt32.factory({
42-
'seed': tinymt32.seed
42+
'seed': tinymt32.seed
4343
});
4444
console.log( '\nseed: %d', rand.seed[ 0 ] );
4545
for ( i = 0; i < 100; i++ ) {
46-
console.log( rand() );
47-
}
46+
console.log( rand() );
47+
}

lib/node_modules/@stdlib/random/base/tinymt32/include/stdlib/random/base/tinymt32.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @license Apache-2.0
33
*
4-
* Copyright (c) 2024 The Stdlib Authors.
4+
* Copyright (c) 2025 The Stdlib Authors.
55
*
66
* Licensed under the Apache License, Version 2.0 (the "License");
77
* you may not use this file except in compliance with the License.
@@ -73,4 +73,4 @@ int8_t stdlib_base_random_tinymt32_set( struct BasePRNGObject *obj, const void *
7373
}
7474
#endif
7575

76-
#endif // !STDLIB_RANDOM_BASE_TINYMT32_H
76+
#endif // !STDLIB_RANDOM_BASE_TINYMT32_H

0 commit comments

Comments
 (0)