(item: TransformDiffItem<T>)
| 104 | cloner: (original: T) => T, |
| 105 | ): ApplyTransformResult<T> { |
| 106 | function insert(item: TransformDiffItem<T>) { |
| 107 | let idIndex = -1; |
| 108 | const index = item.before |
| 109 | ? current.findIndex(({id}) => { |
| 110 | if (id === item.before?.id) { |
| 111 | idIndex++; |
| 112 | if (idIndex === item.beforeIdIndex) return true; |
| 113 | } |
| 114 | return false; |
| 115 | }) |
| 116 | : 0; |
| 117 | current.splice(index + 1, 0, item.current); |
| 118 | } |
| 119 | |
| 120 | const result: ApplyTransformResult<T> = { |
| 121 | inserted: diff.inserted.map(item => ({ |
no outgoing calls
no test coverage detected