Sha256: 2544a0ffe23adc5be309104c5831bcdc7c29d3e4211b6990cfbef28cc9e7ad9c

Contents?: true

Size: 1.1 KB

Versions: 270

Compression:

Stored size: 1.1 KB

Contents

var baseIsEqual = require('./_baseIsEqual'),
    get = require('./get'),
    hasIn = require('./hasIn'),
    isKey = require('./_isKey'),
    isStrictComparable = require('./_isStrictComparable'),
    matchesStrictComparable = require('./_matchesStrictComparable'),
    toKey = require('./_toKey');

/** Used to compose bitmasks for value comparisons. */
var COMPARE_PARTIAL_FLAG = 1,
    COMPARE_UNORDERED_FLAG = 2;

/**
 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
 *
 * @private
 * @param {string} path The path of the property to get.
 * @param {*} srcValue The value to match.
 * @returns {Function} Returns the new spec function.
 */
function baseMatchesProperty(path, srcValue) {
  if (isKey(path) && isStrictComparable(srcValue)) {
    return matchesStrictComparable(toKey(path), srcValue);
  }
  return function(object) {
    var objValue = get(object, path);
    return (objValue === undefined && objValue === srcValue)
      ? hasIn(object, path)
      : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  };
}

module.exports = baseMatchesProperty;

Version data entries

270 entries across 269 versions & 28 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.59 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.58 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.57 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.56 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.55 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.54 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.53 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.52 node_modules/lodash/_baseMatchesProperty.js
trusty-cms-6.3.1 node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.51 node_modules/lodash/_baseMatchesProperty.js
boring_generators-0.15.0 tmp/templates/app_template/node_modules/lodash/_baseMatchesProperty.js
clapton-0.0.26 lib/clapton/javascripts/node_modules/lodash/_baseMatchesProperty.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/lodash/_baseMatchesProperty.js
immosquare-cleaner-0.1.50 node_modules/lodash/_baseMatchesProperty.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/lodash/_baseMatchesProperty.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/lodash/_baseMatchesProperty.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/lodash/_baseMatchesProperty.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/lodash/_baseMatchesProperty.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/lodash/_baseMatchesProperty.js