-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
IParameterTypeDefinition regexp #1702
Comments
Hi :) Thanks for the report. Could you please give more details regarding the original issue you were facing? Did you consider creating a pull request with your changes? |
The I think an even better fix would be to adopt the same type: regexp: readonly RegExp[] | readonly string[] | RegExp | string Note that the cucumber-expressions library uses the plural |
The issue i faced was when defining custom parameter types: For example:
note: the above example syntax makes no real sense, it's for a POC which I refactored a few times and so don't actually need both, but the library supports it so the typescript patch stayed I raised the issue because I had a patch via patch-package and it offered to do it via a template, so was pretty quick 🙈 happy to raise a PR in the next few days if noone beats me to it! |
@yasserf do you mean you wanted to use an array of regexps but it yielded a TypeScript compilation error (even though it would work at runtime)? |
Yup, I just patched the type but the functionality itself worked as expected
This was a few months ago, so I can’t say for certain it’s still the case
…On Fri, 25 Jun 2021 at 12:42, David Goss ***@***.***> wrote:
@yasserf <https://github.com/yasserf> do you mean you wanted to use an
array of regexps but it yielded a TypeScript compilation error (even though
it would work at runtime)?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1702 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAU3WS6RKTTI6S25PHUIGS3TURMRFANCNFSM47DH7IUA>
.
|
Thanks for confirming @yasserf. I've pushed a test for the TypeScript typing to this branch, which fails as of now and should pass (along with all existing change) once the change @aslakhellesoy suggests is made. If you or anyone interested would like to do a PR for this, that would be great. |
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
@cucumber/[email protected]
for the project I'm working on.The IParameterTypeDefinition in code supported both RegExp and arrays of them.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.
The text was updated successfully, but these errors were encountered: