-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(types): Fixes array over union sub-return-types. (#31)
* Fixes array over union sub-return-types. Wraps the ${first} return type in parentheses so that array type augments the whole sub-type e.g., in case the sub-type is a union. E.g., ``` From: mget(...keys: string[]): Promise<string | null[]>; // string | Array<null> to: mget(...keys: string[]): Promise<(string | null)[]>; // Array<string | null> From: hmget(key: string, ...fields: string[]): Promise<string | null[]>; // string | Array<null> to: hmget(key: string, ...fields: string[]): Promise<(string | null)[]>; // Array<string | null> ``` * Reduces noise in and includes generated code for PR#31 Adds generated code for CI guard Reduces noise in generated types via extra check for pipe character so that parens are only added when the generated array sub-type is actually a union type. This seems to work fine for the current data types. Hopefully we won't ever need a parser to actually check for balanced parens various expressions before adding more. * Changes most generated array types to use `Array<>` syntax per mmkal. * Restores const for `first` return type. * chore(style): use brackets for simple types
- Loading branch information
1 parent
62961d4
commit 37b52f9
Showing
3 changed files
with
8 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
"tslint:recommended" | ||
], | ||
"rules": { | ||
"array-type": false, | ||
"no-console": [ | ||
true | ||
], | ||
|