mirror of
https://github.com/ANL-CEEESA/UnitCommitment.jl.git
synced 2025-12-08 01:08:50 -06:00
web: ThermalUnits: CSV upload
This commit is contained in:
@@ -51,6 +51,18 @@ export const parseNumber = (
|
||||
}
|
||||
};
|
||||
|
||||
export const parseBool = (
|
||||
valueStr: string,
|
||||
): [boolean, ValidationError | null] => {
|
||||
if (["true", "1"].includes(valueStr.toLowerCase())) {
|
||||
return [true, null];
|
||||
}
|
||||
if (["false", "0"].includes(valueStr.toLowerCase())) {
|
||||
return [false, null];
|
||||
}
|
||||
return [true, { message: `"${valueStr}" is not a valid boolean value` }];
|
||||
};
|
||||
|
||||
export const changeStringData = (
|
||||
field: string,
|
||||
newValue: string,
|
||||
|
||||
Reference in New Issue
Block a user