MCPcopy Create free account
hub / github.com/ccxt/ccxt / addKeyInArrayItems

Method addKeyInArrayItems

js/src/base/Exchange.js:4129–4143  ·  view source on GitHub ↗
(obj, keyName)

Source from the content-addressed store, hash-verified

4127 return arr[length - 1];
4128 }
4129 addKeyInArrayItems(obj, keyName) {
4130 const result = [];
4131 const keys = Object.keys(obj);
4132 for (let i = 0; i < keys.length; i++) {
4133 const key = keys[i];
4134 const item = obj[key];
4135 if (item === undefined) {
4136 continue;
4137 }
4138 const itemWithKey = this.extend({}, item);
4139 itemWithKey[keyName] = key;
4140 result.push(itemWithKey);
4141 }
4142 return result;
4143 }
4144 invertFlatStringDictionary(dict) {
4145 const reversed = {};
4146 const keys = Object.keys(dict);

Callers 4

fetchCurrenciesMethod · 0.45
fetchCurrenciesMethod · 0.45
fetchCurrenciesMethod · 0.45
fetchCurrenciesMethod · 0.45

Calls 2

extendMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected