* IArrayData: [items[], ...dataTypesPerItem]. Items are walked and each is * reassigned through the type dispatcher.
(ctx, data)
| 433 | * reassigned through the type dispatcher. |
| 434 | */ |
| 435 | function decodeArray(ctx, data) { |
| 436 | if (!Array.isArray(data) || data.length === 0) return data; |
| 437 | const items = Array.isArray(data[0]) ? data[0].slice() : []; |
| 438 | for (let i = 0; i < items.length; i += 1) { |
| 439 | const dataType = data[i + 1]; |
| 440 | if (dataType === DataTypeID.SimpleType || dataType == null) continue; |
| 441 | assignByType(ctx, items, i, dataType, items[i]); |
| 442 | } |
| 443 | return items; |
| 444 | } |
| 445 | |
| 446 | // --------------------------------------------------------------------------- |
| 447 | // Cross-references (refs table) |
no test coverage detected