Sha256: 77ff2aeb024d9e1679c00705067159c1b98ccac8310987a0bdaf0e38a6ca7333

Contents?: true

Size: 412 Bytes

Versions: 28

Compression:

Stored size: 412 Bytes

Contents

/**
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[]];

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/type-fest/source/non-empty-tuple.d.ts