From 0b6caa88bd1aab03d544b3dc989a041263df7eb9 Mon Sep 17 00:00:00 2001 From: David Ward Date: Mon, 8 May 2023 20:27:52 -0700 Subject: [PATCH] Add basic unit tests for ints, phase 6 --- lib/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index 828586e..c78db7a 100755 --- a/lib/util.js +++ b/lib/util.js @@ -4,7 +4,7 @@ * @returns true if array is sorted highest to lowest, false otherwise */ const isSortedHiToLow = (arr) => - arr.every((val, index, arr) => !index || arr[index - 1] > val); + arr.every((val, index, arr) => !index || arr[index - 1] >= val); /** * @@ -12,7 +12,7 @@ const isSortedHiToLow = (arr) => * @returns true if array is sorted lowest to highest, false otherwise */ const isSortedLowToHi = (arr) => - arr.every((val, index, arr) => !index || arr[index - 1] < val); + arr.every((val, index, arr) => !index || arr[index - 1] <= val); module.exports = { isSortedHiToLow,