From 9e09ba29c39385ec5d85d594551d2aab0d074147 Mon Sep 17 00:00:00 2001 From: Blake V <87083504+bvandercar-vt@users.noreply.github.com> Date: Mon, 13 May 2024 12:36:19 -0600 Subject: [PATCH] style: arrow function return shorthand (#136) --- src/spoof.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/spoof.ts b/src/spoof.ts index ba20aed..7549e56 100644 --- a/src/spoof.ts +++ b/src/spoof.ts @@ -233,15 +233,10 @@ export function path (start: Vector, end: BoundingBox | Vector, optionsOrSpread? return clampPositive(re) } -const clampPositive = (vectors: Vector[]): Vector[] => { - const clamp0 = (elem: number): number => Math.max(0, elem) - return vectors.map((vector) => { - return { - x: clamp0(vector.x), - y: clamp0(vector.y) - } - }) -} +const clampPositive = (vectors: Vector[]): Vector[] => vectors.map((vector) => ({ + x: Math.max(0, vector.x), + y: Math.max(0, vector.y) +})) const shouldOvershoot = (a: Vector, b: Vector, threshold: number): boolean => magnitude(direction(a, b)) > threshold