Skip to content

Commit

Permalink
Make determination of highlight start less magic string-y
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Brown committed Dec 9, 2024
1 parent f10de04 commit f5679db
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export const getChangedTemplate = (

const asJSON = JSON.stringify(existingJsonCopy, null, NUM_SPACES);
const end = asJSON.lastIndexOf('}');
// TODO: can we make this magic string based of the actual content?
const start =
end - '}, "": {\n "ownedBy": ""\n }\n }\n'.length - network.length - address.length;
// highlight should start where the drips object starts a second
// object listing...for now.
const start = asJSON.indexOf(',\n');

return [asJSON, [start, end]];
};
Expand Down

0 comments on commit f5679db

Please sign in to comment.