Skip to content

Commit 4bd27a3

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents b1ed7bc + 669f8e5 commit 4bd27a3

File tree

11 files changed

+181
-106
lines changed

11 files changed

+181
-106
lines changed

lib/node_modules/@stdlib/_tools/lint/header-filenames/lib/sync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var IGNORE = require( './ignore_patterns.json' );
4343
*
4444
* @example
4545
* var errs = lint();
46-
* // returns [...]
46+
* // returns []
4747
*/
4848
function lint( options ) {
4949
var pattern;

lib/node_modules/@stdlib/_tools/pkgs/entry-points/lib/entries.sync.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function entryPoints( pkgs ) {
6060
var k;
6161

6262
total = pkgs.length;
63-
out = new Array( total );
63+
out = [];
6464

6565
debug( 'Determining main entry points for %d packages...', total );
6666
for ( i = 0; i < total; i++ ) {
@@ -69,14 +69,14 @@ function entryPoints( pkgs ) {
6969
main = pkgs[ i ].id;
7070

7171
debug( 'Determined main entry point for package: %s (%d of %d). Main: %s', pkg, k, total, main );
72-
out[ i ] = {
72+
out.push({
7373
'id': main,
7474
'pkg': pkg,
7575
'dir': pkgs[ i ].dir,
7676
'entries': [
7777
main
7878
]
79-
};
79+
});
8080
}
8181
debug( 'Finished determining main entry points.' );
8282

lib/node_modules/@stdlib/_tools/scaffold/math-strided-binary-by/scripts/scaffold.sh

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ desc_link_text=${DESC_LINK_TEXT:-'addition'}
6868
# Define a list of keywords:
6969
if [[ -z "${KEYWORDS:-}" ]]; then
7070
keywords=(
71-
"stdmath"
72-
"mathematics"
73-
"math"
74-
"add"
75-
"sum"
76-
"addition"
77-
"arithmetic"
78-
"summation"
71+
"stdmath"
72+
"mathematics"
73+
"math"
74+
"add"
75+
"sum"
76+
"addition"
77+
"arithmetic"
78+
"summation"
7979
)
8080
else
8181
IFS=','; read -ra keywords <<< "${KEYWORDS}"; IFS=' ';
@@ -90,14 +90,14 @@ rand_max=${RAND_MAX:-'10.0'}
9090
# Define a list of values for first input array:
9191
if [[ -z "${X_VALUES_LEN_8:-}" ]]; then
9292
x_values_len_8=(
93-
'1.0'
94-
'2.0'
95-
'3.0'
96-
'4.0'
97-
'5.0'
98-
'6.0'
99-
'7.0'
100-
'8.0'
93+
'1.0'
94+
'2.0'
95+
'3.0'
96+
'4.0'
97+
'5.0'
98+
'6.0'
99+
'7.0'
100+
'8.0'
101101
)
102102
else
103103
IFS=','; read -ra x_values_len_8 <<< "${X_VALUES_LEN_8}"; IFS=' ';
@@ -106,14 +106,14 @@ fi
106106
# Define a list of values for second input array:
107107
if [[ -z "${Y_VALUES_LEN_8:-}" ]]; then
108108
y_values_len_8=(
109-
'11.0'
110-
'12.0'
111-
'13.0'
112-
'14.0'
113-
'15.0'
114-
'16.0'
115-
'17.0'
116-
'18.0'
109+
'11.0'
110+
'12.0'
111+
'13.0'
112+
'14.0'
113+
'15.0'
114+
'16.0'
115+
'17.0'
116+
'18.0'
117117
)
118118
else
119119
IFS=','; read -ra y_values_len_8 <<< "${Y_VALUES_LEN_8}"; IFS=' ';
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
{
2-
"options": {},
3-
"fields": [
4-
{
5-
"field": "src",
6-
"resolve": true,
7-
"relative": true
8-
},
9-
{
10-
"field": "include",
11-
"resolve": true,
12-
"relative": true
13-
},
14-
{
15-
"field": "libraries",
16-
"resolve": false,
17-
"relative": false
18-
},
19-
{
20-
"field": "libpath",
21-
"resolve": true,
22-
"relative": false
23-
}
24-
],
25-
"confs": [
26-
{
27-
"src": [
2+
"options": {},
3+
"fields": [
4+
{
5+
"field": "src",
6+
"resolve": true,
7+
"relative": true
8+
},
9+
{
10+
"field": "include",
11+
"resolve": true,
12+
"relative": true
13+
},
14+
{
15+
"field": "libraries",
16+
"resolve": false,
17+
"relative": false
18+
},
19+
{
20+
"field": "libpath",
21+
"resolve": true,
22+
"relative": false
23+
}
24+
],
25+
"confs": [
26+
{
27+
"src": [
2828
"./src/main.c"
2929
],
30-
"include": [
31-
"./include"
32-
],
33-
"libraries": [],
34-
"libpath": [],
35-
"dependencies": [
30+
"include": [
31+
"./include"
32+
],
33+
"libraries": [],
34+
"libpath": [],
35+
"dependencies": [
3636
"@stdlib/assert/napi/status-ok"
3737
]
38-
}
39-
]
38+
}
39+
]
4040
}

lib/node_modules/@stdlib/constants/time/minutes-in-week/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var bool = ( MINUTES_IN_WEEK === 10080 );
4747

4848
## Notes
4949

50-
- The value is a generalization and does **not** take into account inaccuracies due to daylight savings conventions, crossing timezones, or other complications with time and dates.
50+
- The value is a generalization and does **not** take into account inaccuracies due to daylight savings conventions, crossing timezones, or other complications with time and dates.
5151

5252
</section>
5353

lib/node_modules/@stdlib/ndarray/fancy/examples/set_slice.3d.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,18 @@ var s = E( 1, S(0,_,2), _ );
6060
y[ s ] = 100;
6161
console.log( toArray( y ) );
6262
/* =>
63-
[
64-
[
65-
[ 3, 4 ],
66-
[ 5, 6 ],
67-
[ 7, 8 ]
68-
],
69-
[
70-
[ 100, 100 ],
71-
[ 11, 12 ],
72-
[ 100, 100 ]
73-
]
74-
]
63+
[
64+
[
65+
[ 3, 4 ],
66+
[ 5, 6 ],
67+
[ 7, 8 ]
68+
],
69+
[
70+
[ 100, 100 ],
71+
[ 11, 12 ],
72+
[ 100, 100 ]
73+
]
74+
]
7575
*/
7676

7777
// Create a vector of zeros:
@@ -82,16 +82,16 @@ var x = ndzeros( [ 2 ] );
8282
y[ '0,:,:' ] = x;
8383
console.log( toArray( y ) );
8484
/* =>
85-
[
86-
[
87-
[ 0, 0 ],
88-
[ 0, 0 ],
89-
[ 0, 0 ]
90-
],
91-
[
92-
[ 100, 100 ],
93-
[ 11, 12 ],
94-
[ 100, 100 ]
95-
]
96-
]
85+
[
86+
[
87+
[ 0, 0 ],
88+
[ 0, 0 ],
89+
[ 0, 0 ]
90+
],
91+
[
92+
[ 100, 100 ],
93+
[ 11, 12 ],
94+
[ 100, 100 ]
95+
]
96+
]
9797
*/

lib/node_modules/@stdlib/stats/base/dvarmpn/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
int main( void ) {
2424
// Create a strided array:
25-
double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
25+
const double x[] = { 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 };
2626

2727
// Specify the number of elements:
2828
int64_t N = 4;

lib/node_modules/@stdlib/string/base/format-interpolate/lib/format_double.js

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
// MODULES //
2222

23-
var isNumber = require( './is_number.js' );
24-
2523
// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.
2624
var abs = Math.abs; // eslint-disable-line stdlib/no-builtin-math
2725
var lowercase = String.prototype.toLowerCase;
@@ -46,21 +44,15 @@ var RE_ZERO_BEFORE_EXP = /(\..*[^0])0*e/;
4644
* Formats a token object argument as a floating-point number.
4745
*
4846
* @private
47+
* @param {number} f - parsed number
4948
* @param {Object} token - token object
5049
* @throws {Error} must provide a valid floating-point number
5150
* @returns {string} formatted token argument
5251
*/
53-
function formatDouble( token ) {
52+
function formatDouble( f, token ) {
5453
var digits;
5554
var out;
56-
var f = parseFloat( token.arg );
57-
if ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.
58-
if ( !isNumber( token.arg ) ) {
59-
throw new Error( 'invalid floating-point number. Value: ' + out );
60-
}
61-
// Case: NaN, Infinity, or -Infinity
62-
f = token.arg;
63-
}
55+
6456
switch ( token.specifier ) {
6557
case 'e':
6658
case 'E':

lib/node_modules/@stdlib/string/base/format-interpolate/lib/main.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
var formatInteger = require( './format_integer.js' );
2424
var isString = require( './is_string.js' );
25+
var isNumber = require( './is_number.js' );
2526
var formatDouble = require( './format_double.js' );
2627
var spacePad = require( './space_pad.js' );
2728
var zeroPad = require( './zero_pad.js' );
@@ -96,6 +97,7 @@ function formatInterpolate( tokens ) {
9697
var num;
9798
var out;
9899
var pos;
100+
var f;
99101
var i;
100102
var j;
101103

@@ -205,7 +207,16 @@ function formatInterpolate( tokens ) {
205207
if ( !hasPeriod ) {
206208
token.precision = 6;
207209
}
208-
token.arg = formatDouble( token );
210+
f = parseFloat( token.arg );
211+
if ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.
212+
if ( !isNumber( token.arg ) ) {
213+
throw new Error( 'invalid floating-point number. Value: ' + out );
214+
}
215+
// Case: NaN, Infinity, or -Infinity
216+
f = token.arg;
217+
token.padZeros = false;
218+
}
219+
token.arg = formatDouble( f, token );
209220
break;
210221
default:
211222
throw new Error( 'invalid specifier: ' + token.specifier );

lib/node_modules/@stdlib/string/base/format-interpolate/test/test.format_double.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ tape( 'the function returns a double-formatted token argument', function test( t
4444
'precision': 2
4545
};
4646
expected = '3.14';
47-
actual = formatDouble( token );
47+
actual = formatDouble( PI, token );
4848
t.strictEqual( actual, expected, 'returns expected value' );
4949

5050
token = {
@@ -53,7 +53,7 @@ tape( 'the function returns a double-formatted token argument', function test( t
5353
'precision': 4
5454
};
5555
expected = '3.1416';
56-
actual = formatDouble( token );
56+
actual = formatDouble( PI, token );
5757
t.strictEqual( actual, expected, 'returns expected value' );
5858

5959
token = {
@@ -62,7 +62,7 @@ tape( 'the function returns a double-formatted token argument', function test( t
6262
'precision': 2
6363
};
6464
expected = '3.14e+00';
65-
actual = formatDouble( token );
65+
actual = formatDouble( PI, token );
6666
t.strictEqual( actual, expected, 'returns expected value' );
6767

6868
token = {
@@ -71,7 +71,7 @@ tape( 'the function returns a double-formatted token argument', function test( t
7171
'precision': 2
7272
};
7373
expected = '3.14E+00';
74-
actual = formatDouble( token );
74+
actual = formatDouble( PI, token );
7575
t.strictEqual( actual, expected, 'returns expected value' );
7676

7777
t.end();
@@ -89,7 +89,7 @@ tape( 'the function returns a double-formatted token argument (include sign)', f
8989
'sign': '+'
9090
};
9191
expected = '+3.14';
92-
actual = formatDouble( token );
92+
actual = formatDouble( PI, token );
9393
t.strictEqual( actual, expected, 'returns expected value' );
9494

9595
token = {
@@ -99,7 +99,7 @@ tape( 'the function returns a double-formatted token argument (include sign)', f
9999
'sign': '-'
100100
};
101101
expected = '-3.1416';
102-
actual = formatDouble( token );
102+
actual = formatDouble( PI, token );
103103
t.strictEqual( actual, expected, 'returns expected value' );
104104

105105
t.end();

0 commit comments

Comments
 (0)