an-object.js 341 B

1234567891011
  1. var global = require('../internals/global');
  2. var isObject = require('../internals/is-object');
  3. var String = global.String;
  4. var TypeError = global.TypeError;
  5. // `Assert: Type(argument) is Object`
  6. module.exports = function (argument) {
  7. if (isObject(argument)) return argument;
  8. throw TypeError(String(argument) + ' is not an object');
  9. };