Hello-World-Software-Studios / calculator

Carpenter's tool for wall layout
0 stars 1 forks source link

Move `walls.js` constants out of makeAList #37

Closed ecumene closed 3 years ago

JPM709 commented 3 years ago

Moved all hard-coded constants to top level.

`const express = require("express");

const BASE_STUD = 0; const CENTER_SPACING_IMPERIAL = 16; const CENTER_SPACING_METRIC = 406.4; const STUD_OFFSET_IMPERIAL = 0.75; const STUD_OFFSET_METRIC = 19; const router = express.Router();

const getListOfMeasurements = (wallLength, isImperialUnit) => { const newArray = [BASE_STUD]; const onCenterSpacing = isImperialUnit === "true" ? CENTER_SPACING_IMPERIAL : CENTER_SPACING_METRIC; const studOffset = isImperialUnit === "true" ? STUD_OFFSET_IMPERIAL : STUD_OFFSET_METRIC;...`