a-callable.js 336 B

12345678910
  1. var isCallable = require('../internals/is-callable');
  2. var tryToString = require('../internals/try-to-string');
  3. var $TypeError = TypeError;
  4. // `Assert: IsCallable(argument) is true`
  5. module.exports = function (argument) {
  6. if (isCallable(argument)) return argument;
  7. throw $TypeError(tryToString(argument) + ' is not a function');
  8. };