10 lines
151 B
JavaScript
10 lines
151 B
JavaScript
|
export function parseValue(val) {
|
||
|
if (typeof val === 'boolean') {
|
||
|
if (val) {
|
||
|
return 1;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
return parseFloat(val);
|
||
|
}
|