1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 |
|
8 |
|
9 | var constructorIndexInArray = function constructorIndexInArray(array, name) {
|
10 |
|
11 | if (!Array.isArray(array)) {
|
12 |
|
13 | throw new Error('[CarteBlanche] constructorIndexInArray: The first argument must be an array.');
|
14 | }
|
15 | for (var i = 0; i < array.length; i++) {
|
16 |
|
17 | if (array[i] && array[i].constructor.name === name) {
|
18 | return i;
|
19 | }
|
20 | }
|
21 | return false;
|
22 | };
|
23 |
|
24 | exports.default = constructorIndexInArray; |
\ | No newline at end of file |