terminal parses boolean exactly.

This commit is contained in:
Olivier Gagnon 2021-12-03 14:46:40 -05:00
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);
} }