UNPKG
lean4-code-actions
Version:
latest (1.1.32)
1.1.32
Refactorings and snippets for Lean 4
lean4-code-actions
/
libs
/
utils
/
NonEmptyArray
/
ensure.ts
7 lines
(5 loc)
•
213 B
text/typescript
View Raw
1
2
3
4
5
6
7
import
{ ensureByIndex }
from
'../ensure'
import
{
NonEmptyArray
}
from
'./index'
export
const
ensureNonEmptyArray = <T>(
array
: T[]):
NonEmptyArray
<T> => {
return
[
ensureByIndex
(array,
0
), ...array.
slice
(
1
)] }