require-object-coercible.js 328 B

12345678910
  1. var isNullOrUndefined = require('../internals/is-null-or-undefined');
  2. var $TypeError = TypeError;
  3. // `RequireObjectCoercible` abstract operation
  4. // https://tc39.es/ecma262/#sec-requireobjectcoercible
  5. module.exports = function (it) {
  6. if (isNullOrUndefined(it)) throw $TypeError("Can't call method on " + it);
  7. return it;
  8. };