mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2025-01-03 11:57:34 +01:00
terminal parses boolean exactly.
This commit is contained in:
parent
13b08d7cc8
commit
0b92f706ad
@ -99,6 +99,7 @@ export function ParseCommand(command: string): (string | number | boolean)[] {
|
|||||||
const arg = command.substr(start, i - start);
|
const arg = command.substr(start, i - start);
|
||||||
|
|
||||||
// If this is a number, convert it from a string to number
|
// If this is a number, convert it from a string to number
|
||||||
|
console.log(arg);
|
||||||
if (isNumber(arg)) {
|
if (isNumber(arg)) {
|
||||||
args.push(parseFloat(arg));
|
args.push(parseFloat(arg));
|
||||||
} else if (arg === "true") {
|
} else if (arg === "true") {
|
||||||
@ -119,8 +120,13 @@ export function ParseCommand(command: string): (string | number | boolean)[] {
|
|||||||
const arg = command.substr(start, i - start);
|
const arg = command.substr(start, i - start);
|
||||||
|
|
||||||
// If this is a number, convert it from string to number
|
// If this is a number, convert it from string to number
|
||||||
|
console.log(arg);
|
||||||
if (isNumber(arg)) {
|
if (isNumber(arg)) {
|
||||||
args.push(parseFloat(arg));
|
args.push(parseFloat(arg));
|
||||||
|
} else if (arg === "true") {
|
||||||
|
args.push(true);
|
||||||
|
} else if (arg === "false") {
|
||||||
|
args.push(false);
|
||||||
} else {
|
} else {
|
||||||
args.push(arg);
|
args.push(arg);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user