From a575d14b6621d5464d33d52ca642f2db70c3e370 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Tue, 27 Sep 2022 15:09:17 +0200 Subject: fix: move a ton of functions to separate files --- util/numberWithinRange.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 util/numberWithinRange.ts (limited to 'util/numberWithinRange.ts') diff --git a/util/numberWithinRange.ts b/util/numberWithinRange.ts new file mode 100644 index 0000000..ae435ce --- /dev/null +++ b/util/numberWithinRange.ts @@ -0,0 +1,3 @@ +export const numberWithinRange = (num: number, min: number, max: number) => { + return Math.min(Math.max(num, min), max) +} -- cgit v1.2.3