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 guard assertions to asClass and asFunction functions #20

Closed
jeffijoe opened this issue Jun 6, 2017 · 1 comment
Closed

Add guard assertions to asClass and asFunction functions #20

jeffijoe opened this issue Jun 6, 2017 · 1 comment
Assignees

Comments

@jeffijoe
Copy link
Owner

jeffijoe commented Jun 6, 2017

As pointed out by @cjhoward92, not guarding against null or undefined will make the container explode later.

Its as simple as adding some assert(typeof fn === 'function', 'fn must be a function/class')

@jeffijoe jeffijoe self-assigned this Jun 6, 2017
@jeffijoe jeffijoe changed the title Add guard assertions to as* functions Add guard assertions to asClass and asFunction functions Jun 6, 2017
@jeffijoe
Copy link
Owner Author

Excellent work @zer0tonin! Pushed to npm as 2.4.0.

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

No branches or pull requests

1 participant