(parentNode: any, firstChildIndex: number, lastChildIndex: number, replacementText: string)
| 1178 | } |
| 1179 | |
| 1180 | function flattenRangeIntoText(parentNode: any, firstChildIndex: number, lastChildIndex: number, replacementText: string): boolean { |
| 1181 | const children = parentNode.children; |
| 1182 | if (!children) return false; |
| 1183 | if (replacementText === "") { |
| 1184 | children.splice(firstChildIndex, lastChildIndex - firstChildIndex + 1); |
| 1185 | return true; |
| 1186 | } |
| 1187 | children.splice(firstChildIndex, lastChildIndex - firstChildIndex + 1, { type: "JSXText", value: replacementText }); |
| 1188 | return true; |
| 1189 | } |
| 1190 | |
| 1191 | function createInsertionNode(text: string): any { |
| 1192 | if (text === " ") return createSpaceExpressionNode(); |
no outgoing calls
no test coverage detected