项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

20 lines
424 B

  1. /*!
  2. * for-own <https://github.com/jonschlinkert/for-own>
  3. *
  4. * Copyright (c) 2014-2017, Jon Schlinkert.
  5. * Released 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(obj, fn, thisArg) {
  11. forIn(obj, function(val, key) {
  12. if (hasOwn.call(obj, key)) {
  13. return fn.call(thisArg, obj[key], key, obj);
  14. }
  15. });
  16. };