( layout: Layout, layoutItem: LayoutItem )
| 132 | * @returns New layout with the item replaced |
| 133 | */ |
| 134 | export function modifyLayout( |
| 135 | layout: Layout, |
| 136 | layoutItem: LayoutItem |
| 137 | ): LayoutItem[] { |
| 138 | const newLayout: LayoutItem[] = new Array(layout.length); |
| 139 | for (let i = 0; i < layout.length; i++) { |
| 140 | const item = layout[i]; |
| 141 | if (item !== undefined) { |
| 142 | if (layoutItem.i === item.i) { |
| 143 | newLayout[i] = layoutItem; |
| 144 | } else { |
| 145 | newLayout[i] = item; |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | return newLayout; |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * Apply a transformation to a layout item. |
no outgoing calls
no test coverage detected
searching dependent graphs…