MCPcopy Create free account
hub / github.com/sshwsfc/xadmin / mapArray

Method mapArray

packages/xadmin/src/app.js:115–129  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

113 }
114
115 mapArray(key) {
116 return this.reduce(key, (prev, value) => {
117 const values = this.getValue(value)
118 for(const key in values) {
119 prev[key] = (prev[key] || [])
120 const com_value = values[key]
121 if(Array.isArray(com_value)) {
122 prev[key] = prev[key].concat(com_value)
123 } else {
124 prev[key].push(com_value)
125 }
126 }
127 return prev
128 }, {})
129 }
130
131 load_dict(key) {
132 return this.map(key)

Callers 2

getMethod · 0.95
load_dict_listMethod · 0.95

Calls 2

reduceMethod · 0.95
getValueMethod · 0.95

Tested by

no test coverage detected