Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
*/
81
export
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.ts
File · 0.90
getRotationSnapshot
Function · 0.90
kickoutOccludedShapes
Function · 0.90
getDroppedShapesToNewParents
Function · 0.90
getReorderingShapesChanges
Function · 0.90
getOverlapChecker
Function · 0.90
constructor
Method · 0.90
getSelectedShapes
Method · 0.90
getShapesPageBounds
Method · 0.90
getHintingShape
Method · 0.90
getErasingShapes
Method · 0.90
zoomToFit
Method · 0.90
Calls
1
filter
Method · 0.80
Tested by
1
children
Function · 0.68
Used in the wild
real call sites across dependent graphs
searching dependent graphs…