getMatchData.js 523 B

123456789101112131415161718192021
  1. var isStrictComparable = require('./isStrictComparable'),
  2. pairs = require('../object/pairs');
  3. /**
  4. * Gets the propery 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 = pairs(object),
  12. length = result.length;
  13. while (length--) {
  14. result[length][2] = isStrictComparable(result[length][1]);
  15. }
  16. return result;
  17. }
  18. module.exports = getMatchData;