Skip to content

Commit

Permalink
chore: add jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Jun 30, 2021
1 parent 227114b commit 17899de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
import { Separator, ChoiceOptions, ChoiceBase } from 'inquirer';
import { Dictionary, Nullable, ensureString } from '@salesforce/ts-types';

/**
* Generate a formatted table for list and checkbox prompts
*
* Each option should contain the same keys as specified in columns.
* For example,
* const columns = { name: 'Name', type: 'Type', path: 'Path' };
* const options = [{ name: 'foo', type: 'org', path: '/path/to/foo/' }];
* generateTableChoices(columns, options);
*/
export function generateTableChoices<T>(
columns: Dictionary<string>,
choices: Array<Dictionary<Nullable<string> | T>>,
Expand Down

0 comments on commit 17899de

Please sign in to comment.