Comment

Comment by triyambakam

Or better:

    type NonEmptyArray = [unknown, ...unknown[]];
    const nea: NonEmptyArray = [];
    //    ^^^ Type '[]' is not assignable to type 'NonEmptyArray'.
    //        Source has 0 element(s) but target requires 1.
parent triyambakam 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton