Skip to content

Commit 4b85633

Browse files
committed
Use global isFinite function
1 parent 04f3bcc commit 4b85633

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

lib/node_modules/@stdlib/string/format/lib/format_double.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var isUppercase = require( '@stdlib/assert/is-uppercase' );
24-
var isfinite = require( '@stdlib/math/base/assert/is-finite' );
2524
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
2625

2726
// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.
@@ -56,7 +55,7 @@ function formatDouble( token ) {
5655
var digits;
5756
var out;
5857
var f = parseFloat( token.arg );
59-
if ( !isfinite( f ) ) {
58+
if ( !isFinite( f ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` to avoid circular dependencies.
6059
if ( !isNumber( token.arg ) ) {
6160
throw new Error( 'invalid floating-point number. Value: ' + out );
6261
}

lib/node_modules/@stdlib/string/format/lib/format_integer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var isUppercase = require( '@stdlib/assert/is-uppercase' );
24-
var isfinite = require( '@stdlib/math/base/assert/is-finite' );
2524
var isNumber = require( '@stdlib/assert/is-number' ).isPrimitive;
2625
var zeroPad = require( './zero_pad.js' );
2726

@@ -69,7 +68,7 @@ function formatInteger( token ) {
6968
}
7069
out = token.arg;
7170
i = parseInt( out, 10 );
72-
if ( !isfinite( i ) ) {
71+
if ( !isFinite( i ) ) { // NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` to avoid circular dependencies.
7372
if ( !isNumber( out ) ) {
7473
throw new Error( 'invalid integer. Value: ' + out );
7574
}

0 commit comments

Comments
 (0)