Skip to content

Commit

Permalink
Refa. const -> var
Browse files Browse the repository at this point in the history
For compability with ES5 according to gabzim#2
  • Loading branch information
johachi committed Feb 2, 2020
1 parent 49f32da commit d3b04de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions input-validation/validateCenter.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
exports.validateCenter = function validateCenter(center) {
const validCenterLengths = [2, 3]
var validCenterLengths = [2, 3]
if (!Array.isArray(center) || !validCenterLengths.includes(center.length)) {
throw new Error("ERROR! Center has to be an array of length two or three");
}
const [lng, lat] = center;

var [lng, lat] = center;
if (typeof lng !== "number" || typeof lat !== "number") {
throw new Error(
`ERROR! Longitude and Latitude has to be numbers but where ${typeof lng} and ${typeof lat}`
Expand Down

0 comments on commit d3b04de

Please sign in to comment.