MCPcopy Index your code
hub / github.com/ccxt/ccxt / addKeyInArrayItems

Method addKeyInArrayItems

java/lib/src/main/java/io/github/ccxt/Exchange.java:7109–7126  ·  view source on GitHub ↗
(Object obj, Object keyName)

Source from the content-addressed store, hash-verified

7107 }
7108
7109 public Object addKeyInArrayItems(Object obj, Object keyName)
7110 {
7111 Object result = new java.util.ArrayList<Object>(java.util.Arrays.asList());
7112 Object keys = Helpers.objectKeys(obj);
7113 for (var i = 0; Helpers.isLessThan(i, Helpers.getArrayLength(keys)); i++)
7114 {
7115 Object key = Helpers.GetValue(keys, i);
7116 Object item = Helpers.GetValue(obj, key);
7117 if (Helpers.isTrue(Helpers.isEqual(item, null)))
7118 {
7119 continue;
7120 }
7121 Object itemWithKey = this.extend(new java.util.HashMap<String, Object>() {{}}, item);
7122 Helpers.addElementToObject(itemWithKey, keyName, key);
7123 ((java.util.List<Object>)result).add(itemWithKey);
7124 }
7125 return result;
7126 }
7127
7128 public Object invertFlatStringDictionary(Object dict)
7129 {

Callers 4

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

Calls 9

objectKeysMethod · 0.95
isLessThanMethod · 0.95
getArrayLengthMethod · 0.95
GetValueMethod · 0.95
isTrueMethod · 0.95
isEqualMethod · 0.95
extendMethod · 0.95
addElementToObjectMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected