_getMatchData.js 573 B

12345678910111213141516171819202122232425
  1. var isStrictComparable = require('./_isStrictComparable'),
  2. keys = require('./keys');
  3. /**
  4. * Gets the property names, values, and compare flags of `object`.
  5. *
  6. * @private
  7. * @param {Object} object The object to query.
  8. * @returns {Array} Returns the match data of `object`.
  9. */
  10. function getMatchData(object) {
  11. var result = keys(object),
  12. length = result.length;
  13. while (length--) {
  14. var key = result[length],
  15. value = object[key];
  16. result[length] = [key, value, isStrictComparable(value)];
  17. }
  18. return result;
  19. }
  20. module.exports = getMatchData;