Move value parsing to separate lib

This commit is contained in:
Henri Bergius 2017-11-30 21:21:40 +01:00
parent ed672c7214
commit 9e6ca61dcf
2 changed files with 12 additions and 11 deletions

9
lib/values.js Normal file
View file

@ -0,0 +1,9 @@
export function parseValue(val) {
if (typeof val === 'boolean') {
if (val) {
return 1;
}
return 0;
}
return parseFloat(val);
}