* Return the index of the matching object * @method * @memberof Popper.Utils * @argument {Array} arr * @argument prop * @argument value * @returns index or -1
(arr, prop, value)
| 3827 | |
| 3828 | |
| 3829 | function findIndex(arr, prop, value) { |
| 3830 | // use native findIndex if supported |
| 3831 | if (Array.prototype.findIndex) { |
| 3832 | return arr.findIndex(function (cur) { |
| 3833 | return cur[prop] === value; |
| 3834 | }); |
| 3835 | } // use `find` + `indexOf` if `findIndex` isn't supported |
| 3836 | |
| 3837 | |
| 3838 | var match = find(arr, function (obj) { |
| 3839 | return obj[prop] === value; |
| 3840 | }); |
| 3841 | return arr.indexOf(match); |
| 3842 | } |
| 3843 | /** |
| 3844 | * Loop trough the list of modifiers and run them in order, |
| 3845 | * each of them will then edit the data object. |
no test coverage detected
searching dependent graphs…