Function
compatibleArrayPutAccessor
(
elementTypeId: number,
result: string,
item: string,
index: string,
)
Source from the content-addressed store, hash-verified
| 101 | } |
| 102 | |
| 103 | function compatibleArrayPutAccessor( |
| 104 | elementTypeId: number, |
| 105 | result: string, |
| 106 | item: string, |
| 107 | index: string, |
| 108 | ): string { |
| 109 | switch (elementTypeId) { |
| 110 | case TypeId.BOOL: |
| 111 | case TypeId.BFLOAT16: |
| 112 | return `${result}.setValue(${index}, ${item})`; |
| 113 | case TypeId.FLOAT16: |
| 114 | return `typeof ${result}.setValue === "function" ? ${result}.setValue(${index}, ${item}) : ${result}[${index}] = ${item}`; |
| 115 | default: |
| 116 | return `${result}[${index}] = ${item}`; |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | class CollectionAnySerializer { |
| 121 | constructor( |
Tested by
no test coverage detected