@lucid-softworks/array-first
v0.1.0
Published
Read the first array value with non-empty tuple inference.
Maintainers
Readme
@lucid-softworks/array-first
Read the first array value without mutation.
import { first } from "@lucid-softworks/array-first";
first([1, 2, 3]); // 1
first([]); // undefinedGeneral arrays return T | undefined. Non-empty readonly tuples return their
exact head type without undefined.
