Skip to content

default functions should be optional#302

Open
patrickomeara wants to merge 3 commits intoecrmnn:masterfrom
patrickomeara:default-functions-optional
Open

default functions should be optional#302
patrickomeara wants to merge 3 commits intoecrmnn:masterfrom
patrickomeara:default-functions-optional

Conversation

@patrickomeara
Copy link

@patrickomeara patrickomeara commented Jun 22, 2022

The main thing I wanted out of this PR was making the default functions optional. I then started correcting the logic based on Laravel's logic and adding types.

I've used unkown here as we don't know what is going to be returned. I've also copied laravel unless method. It and when take the value as the second argument in the closures, so we effectively don't know what will be returned.

After looking through the code and working on a few PRs I think this package needs to be rewritten in TS. I'm happy to help out as I use this package quite a bit. Writing in typescript will remove disconnect between the javascript and the type definitions.

Let's discuss what's possible @ecrmnn

@ecrmnn
Copy link
Owner

ecrmnn commented Jul 5, 2022

Hi, @patrickomeara

Thanks for your feedback and contribution 😄
I'll have a closer look once I get the time.

I appreciate your work on types and would encourage you to make more contributions on this 🙌

It would be great to transition towards TS, but personally I don't have the time and therefore no intention to rewrite the package to TS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants