Skip to content

Commit

Permalink
style: arrow function return shorthand (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
bvandercar-vt authored May 13, 2024
1 parent 7719c61 commit 9e09ba2
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/spoof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e09ba2

Please sign in to comment.