@lucid-softworks/array-split-at Split an array at a positive or negative index. import { splitAt } from "@lucid-softworks/array-split-at"; splitAt([1, 2, 3], -1); // [[1, 2], [3]] See the exported types and tests for exact edge-case behavior.