| Leo Repp | 58b9f11 | 2021-11-22 11:57:47 +0100 | [diff] [blame^] | 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 | |||||
| 8 | 'use strict'; | ||||
| 9 | |||||
| 10 | var forIn = require('for-in'); | ||||
| 11 | var hasOwn = Object.prototype.hasOwnProperty; | ||||
| 12 | |||||
| 13 | module.exports = function forOwn(obj, fn, thisArg) { | ||||
| 14 | forIn(obj, function(val, key) { | ||||
| 15 | if (hasOwn.call(obj, key)) { | ||||
| 16 | return fn.call(thisArg, obj[key], key, obj); | ||||
| 17 | } | ||||
| 18 | }); | ||||
| 19 | }; | ||||