|
72 | 72 | const responses = await Promise.all( |
73 | 73 | filenames.map((filename) => |
74 | 74 | api_fetch({ schema, params: { filename, supported_feature } }), |
75 | | - ) |
| 75 | + ), |
76 | 76 | ) |
77 | 77 | const values = responses.map((r) => r.data.value.allowed_objects) |
78 | 78 | const allKeys = [...new Set(values.flatMap((v) => Object.keys(v)))] |
79 | 79 | const commonKeys = allKeys.filter( |
80 | | - (key) => !values.some((obj) => !Object.prototype.hasOwnProperty.call(obj, key)), |
| 80 | + (key) => |
| 81 | + !values.some((obj) => !Object.prototype.hasOwnProperty.call(obj, key)), |
81 | 82 | ) |
82 | 83 | const finalObject = {} |
83 | 84 | for (const key of commonKeys) { |
|
95 | 96 | const objectKeys = Object.keys(finalObject) |
96 | 97 | if (objectKeys.length) { |
97 | 98 | const highestLoadScore = Math.max( |
98 | | - ...objectKeys.map((key) => finalObject[key].is_loadable) |
| 99 | + ...objectKeys.map((key) => finalObject[key].is_loadable), |
99 | 100 | ) |
100 | 101 | if (highestLoadScore > 0) { |
101 | 102 | const bestScoreObjects = objectKeys.filter( |
102 | | - (key) => finalObject[key].is_loadable === highestLoadScore |
| 103 | + (key) => finalObject[key].is_loadable === highestLoadScore, |
103 | 104 | ) |
104 | 105 | if (bestScoreObjects.length === 1) { |
105 | 106 | set_geode_object(bestScoreObjects[0]) |
106 | 107 | alreadySelected = true |
107 | 108 | } else { |
108 | 109 | const highestPriority = Math.max( |
109 | 110 | ...bestScoreObjects.map( |
110 | | - (key) => finalObject[key].object_priority ?? -Infinity |
111 | | - ) |
| 111 | + (key) => finalObject[key].object_priority ?? -Infinity, |
| 112 | + ), |
112 | 113 | ) |
113 | 114 | const bestPriorityObjects = bestScoreObjects.filter( |
114 | | - (key) => finalObject[key].object_priority === highestPriority |
| 115 | + (key) => finalObject[key].object_priority === highestPriority, |
115 | 116 | ) |
116 | | - if (highestPriority !== -Infinity && bestPriorityObjects.length === 1) { |
| 117 | + if ( |
| 118 | + highestPriority !== -Infinity && |
| 119 | + bestPriorityObjects.length === 1 |
| 120 | + ) { |
117 | 121 | set_geode_object(bestPriorityObjects[0]) |
118 | 122 | alreadySelected = true |
119 | 123 | } |
|
0 commit comments