-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add parse modes type hints, minor refactoring #15
base: master
Are you sure you want to change the base?
Conversation
@KnorpelSenf , I've simplified code. Could someone review? Also, is it okay, that |
No. Please fix them :) |
@KnightNiwrem this may be the day to set up CI for your repository :D |
I guess they were before me... I haven't figured out their reasons yet. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM after type errors and potential linting errors are fixes.
The only question I have: are we even allowed to change the type from string
to ParseMode
? I think this is a breaking change because it will prevent existing code from compiling. That would mean that this PQ would require a new major version. I am not sure if @KnightNiwrem is fine with that.
If not, we can consider adding a helper type that grammY uses.
type StringWithSuggestions<S extends string> = (string & {}) | S; // permits `string` but gives hints
@evermake are you still interested in fixing this up? |
Changes made:
wellKnownParseModesMap
map was replaced withknownParseModes
object;buildTransformer
(a.k.a.parseMode
) arrow function was transformed to regular function and also was overloaded to show type hints of available parse modes;src/transformer.ts
file formatted with Deno.