UNPKG

lean4-code-actions

Version:

Refactorings and snippets for Lean 4

7 lines (5 loc) 213 B
import { ensureByIndex } from '../ensure' import { NonEmptyArray } from './index' export const ensureNonEmptyArray = <T>(array: T[]): NonEmptyArray<T> => { return [ensureByIndex(array, 0), ...array.slice(1)] }