Tabnine Logo For Javascript
isPlainObject
Code IndexAdd Tabnine to your IDE (free)

How to use
isPlainObject
function
in
lodash

Best JavaScript code snippets using lodash.isPlainObject(Showing top 15 results out of 315)

origin: 36node/sketch

function createHumps(keyConverter) {
 return function humps(node) {
  if (isArray(node)) return map(node, humps);
  if (isPlainObject(node))
   return transform(node, createIteratee(keyConverter, humps));
  return node;
 };
}
origin: clippedjs/clipped

/**
 * editPkg - writes to pacakge.json
 *
 * @param {Clipped} this
 * @param {(Object | Function)} mutator
 * @returns Promise<any>
 */
function editPkg(this: Clipped, mutator: Object | Function): Promise<any> {
 if (isPlainObject(mutator)) {
  merge(this.config.packageJson, mutator)
 } else if (isFunction(mutator)) {
  mutator(this.config.packageJson)
 }
 return require('write-pkg')(this.config.context, this.config.packageJson.toConfig())
}
origin: clippedjs/clipped

function nestChainable (instance) {
 if (!instance || instance.__keyarray__ || instance.__objectmap__ || instance.__jointed__ || instance.__aliasfunction__) return instance

 //  If is array make it keyable
 if (Array.isArray(instance) && !instance.__keyarray__) {
  return new KeyArray(...instance.map(el => (el.key && el.value) ? {key: el.key, value: nestChainable(el.value)} : nestChainable(el)))
 }
 // If is object convert to Map
 if (isPlainObject(instance) && instance !== null && !(instance instanceof Map)) {
  return new ObjectMap(Object.keys(instance).map(k => [k, nestChainable(instance[k])]))
 }
 return instance
}
origin: manaflair/mylittledom

export function makeRuleset(... parts) {

  let ruleset = new Ruleset();
  let style = new EasyStyle(ruleset);

  for (let t = 0; t < parts.length; ++t) {

    if (isString(parts[t])) {

      style = new EasyStyle(ruleset, parseSelector(parts[t]));

    } else if (isPlainObject(parts[t])) {

      Object.assign(style, parts[t]);

    } else {

      throw new Error(`Failed to execute 'makeRuleset': Parameter ${t + 1} is not of type string, nor it is a plain object.`);

    }

  }

  return ruleset;

}
origin: Radrw/strapi-pro

const templateConfigurations = function (obj) {
 // Allow values which looks like such as
 // an ES6 literal string without parenthesis inside (aka function call).
 return Object.keys(obj).reduce((acc, key) => {
  if (isPlainObject(obj[key]) && !isString(obj[key])) {
   acc[key] = templateConfigurations(obj[key]);
  } else if (isString(obj[key]) && obj[key].match(regex) !== null) {
   acc[key] = eval('`' + obj[key] + '`');
  } else {
   acc[key] = obj[key];
  }

  return acc;
 }, {});
}
origin: buckless/requelize

constructor (initialData = {}) {
    if (initialData instanceof Model) {
     return initialData
    }

    // Create getters/setters
    bindSchemaToModel(Model, this)
    // Create virtual getters
    bindVirtuals(Model, this)

    hiddenProp(this, '_data', {})
    hiddenProp(this, '_pivot', {})
    hiddenProp(this, '_validate', true)
    hiddenProp(this, '_saved', false)

    if (isPlainObject(initialData)) {
     // Set initial values (must be after getters/setters)
     for (const key of Object.keys(initialData)) {
      this[key] = initialData[key]
     }
    }

    debug(`instanciating ${Model._name} with data ${JSON.stringify(this._data)}`)
   }
origin: clippedjs/clipped

if (isFunction(res)) {
 res = await res.call(this, this)
} else if (isPlainObject(res)) {    // Config mutation
 this.defer(res)
 res = null
origin: manaflair/mylittledom

if (isPlainObject(parser)) {
origin: TryGhost/Ghost-CLI

/**
   * Sets a value in the config.
   * If 'value' is null, removes the key from the config
   *
   * @param {string} key Key to set
   * @param {any} value Value to set at `key`
   * @return Config This config instance
   *
   * @method get
   * @public
   */
  set(key, value) {
    if (isPlainObject(key)) {
      Object.assign(this.values, key);
      return this;
    }

    // Setting a value to null removes it from the config
    if (value === null) {
      delete this.values[key];
      return this;
    }

    _set(this.values, key, value);
    return this;
  }
origin: clippedjs/clipped

function normalizeDefer(mutator: any = () => {}): any {
 if (isPlainObject(mutator)) {
  return (clipped: Clipped) => {
   Object.keys(mutator).map(key => {
    if (isFunction(mutator[key])) {
     if (clipped.config.toConfig()[key]) {
      mutator[key](clipped.config[key], clipped)
     }
    } else if (isPlainObject(mutator[key])) {
     if (!clipped.config[key]) {
      clipped.config[key] = mutator[key]
     } else {
      Object.assign(clipped.config[key], mutator[key])
     }
    } else {
     clipped.config[key] = mutator[key]
    }
   })
  }
 } else {
  return mutator
 }
}
origin: mariobermudezjr/ecommerce-react-graphql-stripe

const bindLayout = function (object) {
 return Object.keys(object).reduce((acc, current) => {
  if (isPlainObject(object[current])) {
   acc[current] = bindLayout.call(this, object[current]);
  } else if (isFunction(object[current])) {
   acc[current] = object[current].bind(this);
  } else {
   acc[current] = object[current];
  }

  return acc;
 }, {});
}
origin: LindenHolt-Whittaker/styleguidist-bug-reproduction

} else if (!isPlainObject(config)) {
origin: 36node/sketch

function createHumps(keyConverter) {
 return function humps(node) {
  if (isArray(node)) return map(node, humps);
  if (isPlainObject(node))
   return transform(node, createIteratee(keyConverter, humps));
  return node;
 };
}
origin: 36node/sketch

function createHumps(keyConverter) {
 return function humps(node) {
  if (isArray(node)) return map(node, humps);
  if (isPlainObject(node))
   return transform(node, createIteratee(keyConverter, humps));
  return node;
 };
}
origin: 36node/sketch

function createHumps(keyConverter) {
 return function humps(node) {
  if (isArray(node)) return map(node, humps);
  if (isPlainObject(node))
   return transform(node, createIteratee(keyConverter, humps));
  return node;
 };
}
lodash(npm)isPlainObject

Most used lodash functions

  • LoDashStatic.map
    Creates an array of values by running each element in collection through iteratee. The iteratee is
  • LoDashStatic.isEmpty
    Checks if value is empty. A value is considered empty unless it’s an arguments object, array, string
  • LoDashStatic.forEach
    Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked wit
  • LoDashStatic.find
    Iterates over elements of collection, returning the first element predicate returns truthy for.
  • LoDashStatic.pick
    Creates an object composed of the picked `object` properties.
  • LoDashStatic.get,
  • LoDashStatic.isArray,
  • LoDashStatic.filter,
  • LoDashStatic.merge,
  • LoDashStatic.isString,
  • LoDashStatic.isFunction,
  • LoDashStatic.assign,
  • LoDashStatic.extend,
  • LoDashStatic.includes,
  • LoDashStatic.keys,
  • LoDashStatic.cloneDeep,
  • LoDashStatic.uniq,
  • LoDashStatic.isObject,
  • LoDashStatic.omit

Popular in JavaScript

  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • async
    Higher-order functions and common patterns for asynchronous code
  • winston
    A logger for just about everything.
  • qs
    A querystring parser that supports nesting and arrays, with a depth limit
  • fs-extra
    fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.
  • redis
    Redis client library
  • path
  • debug
    small debugging utility
  • semver
    The semantic version parser used by npm.
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now