Skip to content

Commit

Permalink
buh
Browse files Browse the repository at this point in the history
workaround for #49
  • Loading branch information
Govorunb committed Jun 15, 2024
1 parent 45a7b6e commit ee36a8e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions ebs/src/modules/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ function validateArgs(config: Config, cart: Cart, logContext: LogMessage): strin
}
const minLength = arg.minLength ?? 0;
const maxLength = arg.maxLength ?? 255;
if ((value.length < minLength || value.length > maxLength)
) {
if ((value.length < minLength || value.length > maxLength)) {
return `Text length out of range for ${arg.name}`;
}
break;
Expand All @@ -335,19 +334,21 @@ function validateArgs(config: Config, cart: Cart, logContext: LogMessage): strin
}
if (value === "on") {
cart.args[arg.name] = true;
console.log(cart);
}
break;
case 4: // LiteralTypes.Vector
if (!Array.isArray(value) || value.length != 3) {
if (!Array.isArray(value) || value.length < 3) {
return `Vector3 ${arg.name} not a 3-elem array`;
}
for (const v of value) {
// workaround for #49
const lastThree = value.slice(value.length - 3);
for (const v of lastThree) {
parsed = parseFloat(v);
if (Number.isNaN(parsed)) {
return `Vector3 ${arg.name} components not all floats`;
}
}
cart!.args[arg.name] = lastThree;
break;
default:
const argEnum = config.enums?.[arg.type];
Expand Down

0 comments on commit ee36a8e

Please sign in to comment.