MCPcopy Create free account
hub / github.com/chartbrew/chartbrew / init

Function init

server/modules/fieldFinder.js:39–69  ·  view source on GitHub ↗
(collection)

Source from the content-addressed store, hash-verified

37}
38
39export 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}

Callers

nothing calls this directly

Calls 2

determineTypeFunction · 0.70
findFieldsFunction · 0.70

Tested by

no test coverage detected