reakit-utils
Version:
Reakit utils
13 lines (12 loc) • 298 B
TypeScript
declare type ToArray<T> = T extends any[] ? T : T[];
/**
* Transforms `arg` into an array if it's not already.
*
* @example
* import { toArray } from "reakit-utils";
*
* toArray("a"); // ["a"]
* toArray(["a"]); // ["a"]
*/
export declare function toArray<T>(arg: T): ToArray<T>;
export {};