MCPcopy
hub / github.com/tldraw/tldraw / compact

Function compact

packages/utils/src/lib/array.ts:81–83  ·  view source on GitHub ↗
(arr: T[])

Source from the content-addressed store, hash-verified

79 * @internal
80 */
81export function compact<T>(arr: T[]): NonNullable<T>[] {
82 return arr.filter((i) => i !== undefined && i !== null) as any
83}
84
85/**
86 * Get the last element of an array.

Callers 15

array.test.tsFile · 0.90
getRotationSnapshotFunction · 0.90
kickoutOccludedShapesFunction · 0.90
getOverlapCheckerFunction · 0.90
constructorMethod · 0.90
getSelectedShapesMethod · 0.90
getShapesPageBoundsMethod · 0.90
getHintingShapeMethod · 0.90
getErasingShapesMethod · 0.90
zoomToFitMethod · 0.90

Calls 1

filterMethod · 0.80

Tested by 1

childrenFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…