(collection)
| 37 | } |
| 38 | |
| 39 | export default function init(collection) { |
| 40 | let fields = []; |
| 41 | const explorationSet = []; |
| 42 | |
| 43 | if (!(collection instanceof Array)) { |
| 44 | Object.keys(collection).forEach((field) => { |
| 45 | if (collection[field] instanceof Array) { |
| 46 | explorationSet.push({ |
| 47 | field, |
| 48 | value: collection[field], |
| 49 | type: determineType(collection[field]), |
| 50 | }); |
| 51 | } |
| 52 | }); |
| 53 | } |
| 54 | |
| 55 | if (explorationSet.length > 0) { |
| 56 | for (let i = 0; i < explorationSet.length; i++) { |
| 57 | fields = findFields( |
| 58 | collection[explorationSet[i].field][0], |
| 59 | explorationSet[i].field, |
| 60 | true, |
| 61 | fields |
| 62 | ); |
| 63 | } |
| 64 | } else { |
| 65 | fields = findFields(collection[0], "", true, fields); |
| 66 | } |
| 67 | |
| 68 | return fields; |
| 69 | } |
nothing calls this directly
no test coverage detected