Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoMorenoSirius committed Jun 18, 2024
1 parent dc822bd commit 0aed58c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions apps/mocksi-lite/content/EditMode/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export function fragmentTextNode(
textNode: Node,
newText: string,
) {
if (!textNode.nodeValue) return null
const baseFragment = document.createDocumentFragment();
let cursor = 0;
let index = 0;
Expand All @@ -41,7 +42,6 @@ export function fragmentTextNode(
if (cursor < startOffset) {
baseFragment.appendChild(
document.createTextNode(
//@ts-ignore nodeValue wont be null
textNode.nodeValue.substring(cursor, startOffset),
),
);
Expand All @@ -54,7 +54,6 @@ export function fragmentTextNode(
// end of matches
baseFragment.appendChild(
document.createTextNode(
//@ts-ignore nodeValue wont be null
textNode.nodeValue.substring(endOffset, textNode.nodeValue?.length),
),
);
Expand Down

0 comments on commit 0aed58c

Please sign in to comment.