mirror of
https://github.com/sindresorhus/type-fest.git
synced 2026-01-18 14:53:13 +00:00
12 lines
496 B
TypeScript
12 lines
496 B
TypeScript
import {expectType} from 'tsd';
|
|
import type {ArrayMin} from '../../source/internal';
|
|
import type {NegativeInfinity, PositiveInfinity} from '../../source/numeric';
|
|
|
|
declare const never: never;
|
|
|
|
expectType<ArrayMin<[1, 2, 5, 3, 7, -9, -5, 0]>>(-9);
|
|
expectType<ArrayMin<[1, 2, 5, 3, 7, -9, -5, 0, PositiveInfinity, NegativeInfinity]>>(null! as NegativeInfinity);
|
|
expectType<ArrayMin<[1, 1, 1, 1, 1, 1]>>(1);
|
|
expectType<ArrayMin<[-1, -2, -5]>>(-5);
|
|
expectType<ArrayMin<[-1, -2, number, -5]>>(never);
|