mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-20 06:33:49 +01:00
Merge pull request #3521 from taralx/patch-4
MISC: update @types/numeral and fix type errors
This commit is contained in:
commit
ee5a3ea52c
@ -60,7 +60,7 @@
|
|||||||
"@types/escodegen": "^0.0.7",
|
"@types/escodegen": "^0.0.7",
|
||||||
"@types/file-saver": "^2.0.3",
|
"@types/file-saver": "^2.0.3",
|
||||||
"@types/lodash": "^4.14.168",
|
"@types/lodash": "^4.14.168",
|
||||||
"@types/numeral": "0.0.25",
|
"@types/numeral": "^2.0.2",
|
||||||
"@types/react": "^17.0.21",
|
"@types/react": "^17.0.21",
|
||||||
"@types/react-beautiful-dnd": "^13.1.2",
|
"@types/react-beautiful-dnd": "^13.1.2",
|
||||||
"@types/react-dom": "^17.0.9",
|
"@types/react-dom": "^17.0.9",
|
||||||
|
@ -223,19 +223,21 @@ class NumeralFormatter {
|
|||||||
const parsed = parseFloat(s);
|
const parsed = parseFloat(s);
|
||||||
const selfParsed = this.parseCustomLargeNumber(s);
|
const selfParsed = this.parseCustomLargeNumber(s);
|
||||||
// Check for one or more NaN values
|
// Check for one or more NaN values
|
||||||
if (isNaN(parsed) && numeralValue === null && isNaN(selfParsed)) {
|
if (isNaN(parsed) && isNaN(selfParsed)) {
|
||||||
// 3x NaN
|
if (numeralValue === null) {
|
||||||
return NaN;
|
// 3x NaN
|
||||||
} else if (isNaN(parsed) && isNaN(selfParsed)) {
|
return NaN;
|
||||||
|
}
|
||||||
// 2x NaN
|
// 2x NaN
|
||||||
return numeralValue;
|
return numeralValue;
|
||||||
} else if (numeralValue === null && isNaN(selfParsed)) {
|
} else if (numeralValue === null && isNaN(selfParsed)) {
|
||||||
// 2x NaN
|
// 2x NaN
|
||||||
return parsed;
|
return parsed;
|
||||||
} else if (isNaN(parsed) && numeralValue === null) {
|
|
||||||
// 2x NaN
|
|
||||||
return selfParsed;
|
|
||||||
} else if (isNaN(parsed)) {
|
} else if (isNaN(parsed)) {
|
||||||
|
if (numeralValue === null) {
|
||||||
|
// 2x NaN
|
||||||
|
return selfParsed;
|
||||||
|
}
|
||||||
// 1x NaN
|
// 1x NaN
|
||||||
return this.largestAbsoluteNumber(numeralValue, selfParsed);
|
return this.largestAbsoluteNumber(numeralValue, selfParsed);
|
||||||
} else if (numeralValue === null) {
|
} else if (numeralValue === null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user