mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
# add dist
This commit is contained in:
25
ng2-components/ng2-alfresco-documentslist/dist/node_modules/array-find-index/index.js
generated
vendored
Normal file
25
ng2-components/ng2-alfresco-documentslist/dist/node_modules/array-find-index/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
module.exports = function (arr, predicate, ctx) {
|
||||
if (typeof Array.prototype.findIndex === 'function') {
|
||||
return arr.findIndex(predicate, ctx);
|
||||
}
|
||||
|
||||
if (typeof predicate !== 'function') {
|
||||
throw new TypeError('predicate must be a function');
|
||||
}
|
||||
|
||||
var list = Object(arr);
|
||||
var len = list.length;
|
||||
|
||||
if (len === 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
if (predicate.call(ctx, list[i], i, list)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
Reference in New Issue
Block a user