a zip code crypto-currency system good for red ONLY

every-values-pair.js 780B

1234567891011121314151617181920212223242526272829
  1. var Marker = require('../../../tokenizer/marker');
  2. function everyValuesPair(fn, left, right) {
  3. var leftSize = left.value.length;
  4. var rightSize = right.value.length;
  5. var total = Math.max(leftSize, rightSize);
  6. var lowerBound = Math.min(leftSize, rightSize) - 1;
  7. var leftValue;
  8. var rightValue;
  9. var position;
  10. for (position = 0; position < total; position++) {
  11. leftValue = left.value[position] && left.value[position][1] || leftValue;
  12. rightValue = right.value[position] && right.value[position][1] || rightValue;
  13. if (leftValue == Marker.COMMA || rightValue == Marker.COMMA) {
  14. continue;
  15. }
  16. if (!fn(leftValue, rightValue, position, position <= lowerBound)) {
  17. return false;
  18. }
  19. }
  20. return true;
  21. }
  22. module.exports = everyValuesPair;