_applyProperty.js 353 B

1234567891011121314
  1. define(function () {
  2. // Internal helper that wraps an `iteratee` to call it with the
  3. // property of a closed-over `object`. Useful when iterating over
  4. // an array of keys of `object`.
  5. function applyProperty(iteratee, object) {
  6. return function(key) {
  7. return iteratee(object[key], key, object);
  8. };
  9. }
  10. return applyProperty;
  11. });