Skip to content

Commit

Permalink
removed coupling
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour committed Jun 17, 2023
1 parent b9f0240 commit 93e5d3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
11 changes: 0 additions & 11 deletions src/utils/utils.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ function runOnTableOfValues(table, noDataValue, runOnValues) {
}

const utils = {
// This function takes in an array with an even number of elements and
// returns an array that couples every two consecutive elements;
couple(array) {
const couples = [];
const lengthOfArray = array.length;
for (let i = 0; i < lengthOfArray; i += 2) {
couples.push([array[i], array[i + 1]]);
}
return couples;
},

forceWithin(n, min, max) {
if (n < min) n = min;
else if (n > max) n = max;
Expand Down
9 changes: 0 additions & 9 deletions src/utils/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ test("Get Depth For Multipolygon", async ({ eq }) => {
}
});

test("Test Coupling", ({ eq }) => {
const items = [0, 1, 18, 77, 99, 103];
const actual = utils.couple(items);
eq(actual.length, items.length / 2);
actual.map(couple => {
eq(couple.length, 2);
});
});

test("Test isPolygon", async ({ eq }) => {
const countries = ["Afghanistan", "Ukraine"];
for (let i = 0; i < countries.length; i++) {
Expand Down

0 comments on commit 93e5d3a

Please sign in to comment.