mirror of
https://github.com/sindresorhus/type-fest.git
synced 2025-12-08 19:25:05 +00:00
10 lines
450 B
TypeScript
10 lines
450 B
TypeScript
import {expectType} from 'tsd';
|
|
import type {Arrayable} from '../index';
|
|
|
|
declare const unknown: unknown;
|
|
|
|
expectType<Arrayable<string>>(unknown as string | readonly string[]);
|
|
expectType<Arrayable<string | {foo: number}>>(unknown as (string | {foo: number}) | ReadonlyArray<string | {foo: number}>);
|
|
expectType<Arrayable<never>>(unknown as /* never | */ readonly never[]);
|
|
expectType<Arrayable<string[]>>(unknown as string[] | readonly string[][]);
|