Skip to content
This repository has been archived by the owner on Aug 17, 2021. It is now read-only.

Commit

Permalink
function -> inline
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-haynes committed Dec 16, 2017
1 parent 4b2f3d3 commit 8f36b95
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,7 @@ export async function saveRecipe(recipe) {
apparentAttenuation: round(y.apparentAttenuation / 100, 2)
})));

function parseValue(m) {
m.value = parseFloat(m.value);
return m;
}

const parseValue = (measurement) => Object.assign(measurement, { value: parseFloat(measurement.value) });
const cleanMeasurement = (measurement) => parseValue(pick(measurement, 'value', 'unit'));
const cleanRatio = (ratio) => parseValue(pick(ratio, 'value', 'antecedent', 'consequent'));

Expand Down

0 comments on commit 8f36b95

Please sign in to comment.