Created
May 6, 2015 22:42
-
-
Save dandean/068afee97a3e2d5ac82b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import args from "assert-args"; | |
// Annotate functions for argument warnings in non-production environments: | |
@args({ bar: String, baz: Function }) | |
function foo(bar, baz) { | |
} | |
foo(); | |
// Argument Warning: expected bar to be String, found undefined | |
// Argument Warning: expected baz to be Function, found undefined | |
foo(5, "pow"); | |
// Argument Warning: expected bar to be String, found Number | |
// Argument Warning: expected baz to be Function, found String |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment