Skip to content

Commit

Permalink
Added docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
dobromyslov committed Jan 31, 2021
1 parent f145127 commit b38847f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Converts a single value to the array containing the single value.
* If the value is undefined then returns an empty array.
* @param arrayOrSingleValue A single value or an array.
*/
export function convertToArray<T>(arrayOrSingleValue: T): T[] {
if (arrayOrSingleValue === undefined) {
return [];
Expand Down

0 comments on commit b38847f

Please sign in to comment.