( value: object, options: CompactExecutionPayloadOptions, state: CompactState, depth: number )
| 131 | } |
| 132 | |
| 133 | async function compactEntries( |
| 134 | value: object, |
| 135 | options: CompactExecutionPayloadOptions, |
| 136 | state: CompactState, |
| 137 | depth: number |
| 138 | ): Promise<unknown> { |
| 139 | if (options.rejectLargeValues) { |
| 140 | return compactEntriesWithEarlyReject(value, options, state, depth) |
| 141 | } |
| 142 | |
| 143 | if (Array.isArray(value)) { |
| 144 | return Promise.all(value.map((item) => compactValue(item, options, state, depth + 1))) |
| 145 | } |
| 146 | |
| 147 | return Object.fromEntries( |
| 148 | await Promise.all( |
| 149 | Object.entries(value).map(async ([key, entryValue]) => [ |
| 150 | key, |
| 151 | key === 'finalBlockLogs' && Array.isArray(entryValue) |
| 152 | ? await compactBlockLogs(entryValue as BlockLog[], options) |
| 153 | : await compactValue(entryValue, options, state, depth + 1), |
| 154 | ]) |
| 155 | ) |
| 156 | ) |
| 157 | } |
| 158 | |
| 159 | async function compactEntriesWithEarlyReject( |
| 160 | value: object, |
no test coverage detected