* throw error if the argument is falsy.
(arg, name, reason)
| 1035 | * throw error if the argument is falsy. |
| 1036 | */ |
| 1037 | function assertArg(arg, name, reason) { |
| 1038 | if (!arg) { |
| 1039 | throw new Error("Argument '" + (name || '?') + "' is " + (reason || "required")); |
| 1040 | } |
| 1041 | return arg; |
| 1042 | } |
| 1043 | |
| 1044 | function assertArgFn(arg, name, acceptArrayAnnotation) { |
| 1045 | if (acceptArrayAnnotation && isArray(arg)) { |
no outgoing calls
no test coverage detected