Skip to content

Commit

Permalink
Revert formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ulken committed Oct 19, 2020
1 parent 8fcabe8 commit 1697d17
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,24 @@ declare namespace meow {

type TypedFlag<Flag extends AnyFlag> =
Flag extends {type: 'number'}
? number
: Flag extends {type: 'string'}
? string
: Flag extends {type: 'boolean'}
? boolean
: unknown;
? number
: Flag extends {type: 'string'}
? string
: Flag extends {type: 'boolean'}
? boolean
: unknown;

type PossiblyOptionalFlag<Flag extends AnyFlag, FlagType> =
Flag extends {isRequired: true}
? FlagType
: Flag extends {default: any}
? FlagType
: FlagType | undefined;
? FlagType
: Flag extends {default: any}
? FlagType
: FlagType | undefined;

type TypedFlags<Flags extends AnyFlags> = {
[F in keyof Flags]: Flags[F] extends {isMultiple: true}
? PossiblyOptionalFlag<Flags[F], Array<TypedFlag<Flags[F]>>>
: PossiblyOptionalFlag<Flags[F], TypedFlag<Flags[F]>>
? PossiblyOptionalFlag<Flags[F], Array<TypedFlag<Flags[F]>>>
: PossiblyOptionalFlag<Flags[F], TypedFlag<Flags[F]>>
};

interface Result<Flags extends AnyFlags> {
Expand Down Expand Up @@ -273,14 +273,14 @@ import foo = require('.');
const cli = meow(`
Usage
$ foo <input>
$ foo <input>
Options
--rainbow, -r Include a rainbow
--rainbow, -r Include a rainbow
Examples
$ foo unicorns --rainbow
🌈 unicorns 🌈
$ foo unicorns --rainbow
🌈 unicorns 🌈
`, {
flags: {
rainbow: {
Expand Down

0 comments on commit 1697d17

Please sign in to comment.