Skip to content
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

add type guard for target in guard #323

wants to merge 2 commits into
base: master


Copy link

sergeysova commented Mar 25, 2020

No description provided.

@sergeysova sergeysova requested a review from zerobias Mar 25, 2020
Copy link

zerobias left a comment

Need either typecheck every item in array or avoid type validation at all

This is a common case across codebase, thus we can unify Unit/Unit[] validation and then apply it to guard as well

@@ -25,6 +25,9 @@ export function guard(source, config) {
const {filter, greedy, name = 'guard'} = config
const target = || createEvent(name)
if (!is.unit(source)) source = combine(source)
if (!is.unit(target)) {

This comment has been minimized.

Copy link

zerobias Mar 26, 2020


Target can be an array #284

Copy link

zerobias left a comment

Please run yarn test locally before asking for code review

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

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.