Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/modules / ___dist / chain-able / src / deps / is / hasIn.js
Size: Mime:
"use strict";

const isNull = require("./null");

const isIn = require("./in");
/**
 * @TODO can depreciate now that there is safety in `isIn`
 *
 * @desc isIn, but first checks it is not null
 * @since 5.0.0
 * @memberOf is
 *
 * @param  {Object} obj object to check
 * @param  {any} prop property to check in object
 * @return {boolean}
 *
 * {@link https://github.com/jashkenas/underscore/blob/master/underscore.js#L1367 underscore-has}
 * @see {@link underscore-has}
 *
 * @extends isNull
 * @extends isIn
 *
 * @example
 *
 *  hasIn({}, 'eh') //=> false
 *  hasIn(null, 'eh') //=> false
 *  hasIn({eh: true}, 'eh') //=> true
 *
 */


function hasIn(obj, prop) {
  return !isNull(obj) && isIn(obj, prop);
}

module.exports = hasIn;