From 61b8dbe504b128b4e80595fd43927936ae222786 Mon Sep 17 00:00:00 2001 From: Ruslan Lopatin Date: Fri, 9 Oct 2020 15:53:34 +0700 Subject: [PATCH] Use arrays instead of iterables --- src/option-base.impl.ts | 4 ++-- src/option-syntax.ts | 2 +- src/option.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/option-base.impl.ts b/src/option-base.impl.ts index cd6ec28..ac0bef7 100644 --- a/src/option-base.impl.ts +++ b/src/option-base.impl.ts @@ -59,8 +59,8 @@ export class ZOptionBase implements ZOption { return this._impl.optionLocation(init); } - supportedOptions(): Iterable { - return this._impl.optionsMeta().keys(); + supportedOptions(): readonly string[] { + return [...this._impl.optionsMeta().keys()]; } optionMeta(key: string): ZOptionMeta.Combined { diff --git a/src/option-syntax.ts b/src/option-syntax.ts index 4643966..025d293 100644 --- a/src/option-syntax.ts +++ b/src/option-syntax.ts @@ -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[]; diff --git a/src/option.ts b/src/option.ts index fa66ddc..d498ecd 100644 --- a/src/option.ts +++ b/src/option.ts @@ -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; + supportedOptions(): readonly string[]; /** * Returns meta information for option.