Sha256: 0b08f9192890bfdfc4f274850685f6b3ab46fbfdc453c28c8c8884b5d057bf38

Contents?: true

Size: 824 Bytes

Versions: 153

Compression:

Stored size: 824 Bytes

Contents

var baseIsMatch = require('./baseIsMatch'),
    getMatchData = require('./getMatchData'),
    toObject = require('./toObject');

/**
 * The base implementation of `_.matches` which does not clone `source`.
 *
 * @private
 * @param {Object} source The object of property values to match.
 * @returns {Function} Returns the new function.
 */
function baseMatches(source) {
  var matchData = getMatchData(source);
  if (matchData.length == 1 && matchData[0][2]) {
    var key = matchData[0][0],
        value = matchData[0][1];

    return function(object) {
      if (object == null) {
        return false;
      }
      return object[key] === value && (value !== undefined || (key in toObject(object)));
    };
  }
  return function(object) {
    return baseIsMatch(object, matchData);
  };
}

module.exports = baseMatches;

Version data entries

153 entries across 80 versions & 8 rubygems

Version Path
ilog-0.4.1 node_modules/contents/node_modules/lodash/internal/baseMatches.js
ilog-0.4.1 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/internal/baseMatches.js
ilog-0.4.1 node_modules/babel/node_modules/lodash/internal/baseMatches.js
ilog-0.4.0 node_modules/babel/node_modules/lodash/internal/baseMatches.js
ilog-0.4.0 node_modules/contents/node_modules/lodash/internal/baseMatches.js
ilog-0.4.0 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/internal/baseMatches.js
ilog-0.3.3 node_modules/babel/node_modules/lodash/internal/baseMatches.js
ilog-0.3.3 node_modules/contents/node_modules/lodash/internal/baseMatches.js
ilog-0.3.3 node_modules/babel-plugin-proto-to-assign/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6.3 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6.2 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6.1 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js
xcodebuild-helper-1.2.5 externals/ios-sim-master/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.6 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/configstore/node_modules/js-yaml/node_modules/argparse/node_modules/lodash/internal/baseMatches.js
trusty-festivity-extension-2.5.19 node_modules/bower/node_modules/inquirer/node_modules/lodash/internal/baseMatches.js