mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-03 23:42:50 +00:00
19 lines
513 B
TypeScript
19 lines
513 B
TypeScript
// Type definitions for arrify 1.0
|
|
// Project: https://github.com/sindresorhus/arrify
|
|
// Definitions by: AnJun Wang <https://github.com/wanganjun>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
/**
|
|
* @example
|
|
* arrify(undefined) // returns []
|
|
* @example
|
|
* arrify(null) // returns []
|
|
* @example
|
|
* arrify(1) // returns [1]
|
|
* @example
|
|
* arrify([2, 3]) // returns [2, 3]
|
|
* @param val
|
|
*/
|
|
declare function arrify<T>(val: undefined | null | T | T[]): T[];
|
|
export = arrify;
|