Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
412 B
Text
21 lines
412 B
Text
/**
|
|
Matches any non-empty tuple.
|
|
|
|
@example
|
|
```
|
|
import type {NonEmptyTuple} from 'type-fest';
|
|
|
|
const sum = (...numbers: NonEmptyTuple<number>) => numbers.reduce((total, value) => total + value, 0);
|
|
|
|
sum(1, 2, 3);
|
|
//=> 6
|
|
|
|
sum();
|
|
//=> Error: Expected at least 1 arguments, but got 0.
|
|
```
|
|
|
|
@see {@link RequireAtLeastOne} for objects
|
|
|
|
@category Array
|
|
*/
|
|
export type NonEmptyTuple<T = unknown> = readonly [T, ...T[]];
|