* Inserts items to the list-value. \ * Dispatches a new copy of the value, without mutating the current-value. * * It only works if the Unit is not frozen and there's at least 1 item to be inserted. * * @param start The zero-based index in the list from which to start adding i
(start: number, ...items: Item[])
| 157 | * @category Custom ListUnit |
| 158 | */ |
| 159 | insert(start: number, ...items: Item[]): number { |
| 160 | if (this.isFrozen || !items.length) { |
| 161 | return this.length; |
| 162 | } |
| 163 | this.checkSerializabilityMaybe(items); |
| 164 | |
| 165 | this.splice(start, 0, ...items); // splice also takes care of empty spaces |
| 166 | |
| 167 | return this.length; |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Removes items at given indices from the list-{@link value}. \ |
no test coverage detected