@terminus/ngx-tools
Version:
[![CircleCI][circle-badge]][circle-link] [![codecov][codecov-badge]][codecov-project] [![semantic-release][semantic-release-badge]][semantic-release] [![MIT License][license-image]][license-url] <br> [![NPM version][npm-version-image]][npm-url] [![Github
12 lines (11 loc) • 341 B
TypeScript
/**
* Wraps the provided value in an array, unless the provided value is an array.
*
* @param value - The value to coerce to an array
* @returns An array
*
* @example
* coerceArray<string>('foo'); // Returns: ['foo']
* coerceArray(['foo']); // Returns: ['foo']
*/
export declare const coerceArray: <T>(value: T | T[]) => T[];