Sha256: 994b111bc6f2b384d4e58e7fe6204337db4c8bbbb8a54eff4955f3cad8cbe9c5

Contents?: true

Size: 1.61 KB

Versions: 276

Compression:

Stored size: 1.61 KB

Contents

var baseGetTag = require('./_baseGetTag'),
    getPrototype = require('./_getPrototype'),
    isObjectLike = require('./isObjectLike');

/** `Object#toString` result references. */
var objectTag = '[object Object]';

/** Used for built-in method references. */
var funcProto = Function.prototype,
    objectProto = Object.prototype;

/** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString;

/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;

/** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object);

/**
 * Checks if `value` is a plain object, that is, an object created by the
 * `Object` constructor or one with a `[[Prototype]]` of `null`.
 *
 * @static
 * @memberOf _
 * @since 0.8.0
 * @category Lang
 * @param {*} value The value to check.
 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
 * @example
 *
 * function Foo() {
 *   this.a = 1;
 * }
 *
 * _.isPlainObject(new Foo);
 * // => false
 *
 * _.isPlainObject([1, 2, 3]);
 * // => false
 *
 * _.isPlainObject({ 'x': 0, 'y': 0 });
 * // => true
 *
 * _.isPlainObject(Object.create(null));
 * // => true
 */
function isPlainObject(value) {
  if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
    return false;
  }
  var proto = getPrototype(value);
  if (proto === null) {
    return true;
  }
  var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  return typeof Ctor == 'function' && Ctor instanceof Ctor &&
    funcToString.call(Ctor) == objectCtorString;
}

module.exports = isPlainObject;

Version data entries

276 entries across 274 versions & 30 rubygems

Version Path
rapid_stack-0.2.0 templates/frontend/node_modules/lodash/isPlainObject.js
rapid_stack-0.1.1 templates/FrontEnd/node_modules/lodash/isPlainObject.js
rapid_stack-0.1.0 templates/FrontEnd/node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.60 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.59 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.58 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.57 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.56 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.55 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.54 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.53 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.52 node_modules/lodash/isPlainObject.js
trusty-cms-6.3.1 node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.51 node_modules/lodash/isPlainObject.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/isPlainObject.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/isPlainObject.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/isPlainObject.js
immosquare-cleaner-0.1.50 node_modules/lodash/isPlainObject.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/isPlainObject.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/isPlainObject.js