index.js 414 B

12345678910111213141516171819
  1. /*!
  2. * for-own <https://github.com/jonschlinkert/for-own>
  3. *
  4. * Copyright (c) 2014-2016, Jon Schlinkert.
  5. * Licensed under the MIT License.
  6. */
  7. 'use strict';
  8. var forIn = require('for-in');
  9. var hasOwn = Object.prototype.hasOwnProperty;
  10. module.exports = function forOwn(o, fn, thisArg) {
  11. forIn(o, function(val, key) {
  12. if (hasOwn.call(o, key)) {
  13. return fn.call(thisArg, o[key], key, o);
  14. }
  15. });
  16. };