isObject.js 311 B

12345678910111213141516
  1. 'use strict';
  2. /*!
  3. * Determines if `arg` is an object.
  4. *
  5. * @param {Object|Array|String|Function|RegExp|any} arg
  6. * @api private
  7. * @return {Boolean}
  8. */
  9. module.exports = function(arg) {
  10. if (Buffer.isBuffer(arg)) {
  11. return true;
  12. }
  13. return Object.prototype.toString.call(arg) === '[object Object]';
  14. };