an-object-or-undefined.js 305 B

12345678910
  1. 'use strict';
  2. var isObject = require('../internals/is-object');
  3. var $String = String;
  4. var $TypeError = TypeError;
  5. module.exports = function (argument) {
  6. if (argument === undefined || isObject(argument)) return argument;
  7. throw new $TypeError($String(argument) + ' is not an object or undefined');
  8. };