Skip to content

Commit

Permalink
Use arrays instead of iterables
Browse files Browse the repository at this point in the history
  • Loading branch information
surol committed Oct 9, 2020
1 parent 88bde6b commit 61b8dbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/option-base.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export class ZOptionBase<TOption extends ZOption> implements ZOption {
return this._impl.optionLocation(init);
}

supportedOptions(): Iterable<string> {
return this._impl.optionsMeta().keys();
supportedOptions(): readonly string[] {
return [...this._impl.optionsMeta().keys()];
}

optionMeta(key: string): ZOptionMeta.Combined {
Expand Down
2 changes: 1 addition & 1 deletion src/option-syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type ZOptionSyntax =
/**
* @param args An array of command line arguments to process.
*
* @returns An iterable of option inputs. May be empty if the command line argument has another syntax.
* @returns A read-only array of option inputs. May be empty if the command line argument has another syntax.
*/
(this: void, args: readonly [string, ...string[]]) => readonly ZOptionInput[];

Expand Down
4 changes: 2 additions & 2 deletions src/option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ export interface ZOption {
/**
* Lists all options supported by the parser.
*
* @returns An iterable of all supported option keys except hidden ones.
* @returns A read-only array of all supported option keys except hidden ones.
*/
supportedOptions(): Iterable<string>;
supportedOptions(): readonly string[];

/**
* Returns meta information for option.
Expand Down

0 comments on commit 61b8dbe

Please sign in to comment.