Skip to main content

Function: sanitisePoints()

sanitisePoints(input): ProfilePoint[] | undefined

Defined in: src/lib/classes/ProfileGraphs/index.ts:38

Keep only valid points from an untrusted value, in order from left to right: each on the grid, with a known interpolation. Undefined if there aren't 2 to MAX_PROFILE_POINTS of them.

Parameters​

input​

unknown

Returns​

ProfilePoint[] | undefined

Example​

sanitisePoints([{ x: 10, y: 0, i: "linear" }, { x: 0, y: -10, i: "linear" }]); // sorted by x