mirror of
https://github.com/Azure/k8s-deploy.git
synced 2026-06-25 05:59:26 +08:00
Add node modules and new code for release (#168)
Co-authored-by: OliverMKing <OliverMKing@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
ca8d2604ac
commit
a0f00e5017
+25
@@ -0,0 +1,25 @@
|
||||
var _optimizeCb = require('./_optimizeCb.js');
|
||||
var _isArrayLike = require('./_isArrayLike.js');
|
||||
var keys = require('./keys.js');
|
||||
|
||||
// The cornerstone for collection functions, an `each`
|
||||
// implementation, aka `forEach`.
|
||||
// Handles raw objects in addition to array-likes. Treats all
|
||||
// sparse array-likes as if they were dense.
|
||||
function each(obj, iteratee, context) {
|
||||
iteratee = _optimizeCb(iteratee, context);
|
||||
var i, length;
|
||||
if (_isArrayLike(obj)) {
|
||||
for (i = 0, length = obj.length; i < length; i++) {
|
||||
iteratee(obj[i], i, obj);
|
||||
}
|
||||
} else {
|
||||
var _keys = keys(obj);
|
||||
for (i = 0, length = _keys.length; i < length; i++) {
|
||||
iteratee(obj[_keys[i]], _keys[i], obj);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
module.exports = each;
|
||||
Reference in New Issue
Block a user