You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -55,7 +54,7 @@ function formatDouble( token ) {
55
54
vardigits;
56
55
varout;
57
56
varf=parseFloat(token.arg);
58
-
if(!isFinite(f)){// NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` to avoid circular dependencies.
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.
// NOTE: for the following, we explicitly avoid using stdlib packages in this particular package in order to avoid circular dependencies.
@@ -68,7 +67,7 @@ function formatInteger( token ) {
68
67
}
69
68
out=token.arg;
70
69
i=parseInt(out,10);
71
-
if(!isFinite(i)){// NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` to avoid circular dependencies.
70
+
if(!isFinite(i)){// NOTE: We use the global `isFinite` function here instead of `@stdlib/math/base/assert/is-finite` in order to avoid circular dependencies.
72
71
if(!isNumber(out)){
73
72
thrownewError('invalid integer. Value: '+out);
74
73
}
@@ -98,7 +97,7 @@ function formatInteger( token ) {
* Licensed under the Apache License, Version 2.0 (the "License");
7
+
* you may not use this file except in compliance with the License.
8
+
* You may obtain a copy of the License at
9
+
*
10
+
* http://www.apache.org/licenses/LICENSE-2.0
11
+
*
12
+
* Unless required by applicable law or agreed to in writing, software
13
+
* distributed under the License is distributed on an "AS IS" BASIS,
14
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+
* See the License for the specific language governing permissions and
16
+
* limitations under the License.
17
+
*/
18
+
19
+
'use strict';
20
+
21
+
/**
22
+
* Tests if a value is a number primitive.
23
+
*
24
+
* @param {*} value - value to test
25
+
* @returns {boolean} boolean indicating if a value is a number primitive
26
+
*
27
+
* @example
28
+
* var bool = isNumber( 3.14 );
29
+
* // returns true
30
+
*
31
+
* @example
32
+
* var bool = isNumber( NaN );
33
+
* // returns true
34
+
*
35
+
* @example
36
+
* var bool = isNumber( new Number( 3.14 ) );
37
+
* // returns false
38
+
*/
39
+
functionisNumber(value){
40
+
return(typeofvalue==='number');// NOTE: we inline the `isNumber.isPrimitive` function from `@stdlib/assert/is-number` in order to avoid circular dependencies.
* Licensed under the Apache License, Version 2.0 (the "License");
7
+
* you may not use this file except in compliance with the License.
8
+
* You may obtain a copy of the License at
9
+
*
10
+
* http://www.apache.org/licenses/LICENSE-2.0
11
+
*
12
+
* Unless required by applicable law or agreed to in writing, software
13
+
* distributed under the License is distributed on an "AS IS" BASIS,
14
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+
* See the License for the specific language governing permissions and
16
+
* limitations under the License.
17
+
*/
18
+
19
+
'use strict';
20
+
21
+
/**
22
+
* Tests if a value is a string primitive.
23
+
*
24
+
* @param {*} value - value to test
25
+
* @returns {boolean} boolean indicating if a value is a string primitive
26
+
*
27
+
* @example
28
+
* var bool = isString( 'beep' );
29
+
* // returns true
30
+
*
31
+
* @example
32
+
* var bool = isString( new String( 'beep' ) );
33
+
* // returns false
34
+
*/
35
+
functionisString(value){
36
+
return(typeofvalue==='string');// NOTE: we inline the `isString.isPrimitive` function from `@stdlib/assert/is-string` in order to avoid circular dependencies.
token.padZeros=!flags.includes('-');// NOTE: We use built-in `Array.prototype.includes` here instead of `@stdlib/assert/contains` to avoid circular dependencies.
97
+
token.padZeros=!flags.includes('-');// NOTE: We use built-in `Array.prototype.includes` here instead of `@stdlib/assert/contains` in order to avoid circular dependencies.
0 commit comments