Sha256: 2544a0ffe23adc5be309104c5831bcdc7c29d3e4211b6990cfbef28cc9e7ad9c

Contents?: true

Size: 1.1 KB

Versions: 261

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

261 entries across 260 versions & 28 rubygems

Version Path
sumomo-0.10.0 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
reed_sdk-1.0.1 node_modules/lodash/_baseMatchesProperty.js
reed_sdk-1.0.0 node_modules/lodash/_baseMatchesProperty.js
boring_generators-0.12.0 tmp/templates/app_template/node_modules/lodash/_baseMatchesProperty.js
sumomo-0.9.0 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
sumomo-0.8.22 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
sumomo-0.8.21 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
sumomo-0.8.20 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
sumomo-0.8.17 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
sumomo-0.8.16 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
disco_app-0.18.0 test/dummy/node_modules/lodash/_baseMatchesProperty.js
disco_app-0.18.2 test/dummy/node_modules/lodash/_baseMatchesProperty.js
sumomo-0.8.15 data/sumomo/api_modules/node_modules/lodash/_baseMatchesProperty.js
trusty-cms-5.0.7 node_modules/lodash/_baseMatchesProperty.js
appmap-0.72.2 ./node_modules/lodash/_baseMatchesProperty.js
trusty-cms-5.0.6 node_modules/lodash/_baseMatchesProperty.js
appmap-0.72.1 ./node_modules/lodash/_baseMatchesProperty.js
appmap-0.72.0 ./node_modules/lodash/_baseMatchesProperty.js
trusty-cms-5.0.5 node_modules/lodash/_baseMatchesProperty.js
trusty-cms-5.0.4 node_modules/lodash/_baseMatchesProperty.js