MCPcopy
hub / github.com/mathuo/dockview / tail

Function tail

packages/dockview-core/src/array.ts:1–7  ·  view source on GitHub ↗
(arr: T[])

Source from the content-addressed store, hash-verified

1export function tail<T>(arr: T[]): [T[], T] {
2 if (arr.length === 0) {
3 throw new Error('Invalid tail call');
4 }
5
6 return [arr.slice(0, arr.length - 1), arr[arr.length - 1]];
7}
8
9export function last<T>(arr: T[]): T | undefined {
10 return arr.length > 0 ? arr[arr.length - 1] : undefined;

Callers 8

_doMoveGroupOrPanelMethod · 0.90
moveGroupMethod · 0.90
getRelativeLocationFunction · 0.90
isViewVisibleMethod · 0.90
setViewVisibleMethod · 0.90
addViewMethod · 0.90
removeViewMethod · 0.90
array.spec.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…