(obj, keyName)
| 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); |
no test coverage detected