got to a stable point again. next up is comming up with a decent API for modifications

This commit is contained in:
Chris Kruining 2025-02-25 16:21:21 +11:00
parent 4fb7405466
commit fc22ce6027
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
19 changed files with 498 additions and 375 deletions

View file

@ -1,3 +1,6 @@
export const splice = (subject: string, start: number, end: number, replacement: string) => {
return `${subject.slice(0, start)}${replacement}${Object.is(end, -0) ? '' : subject.slice(end)}`;
};
export const splitAt = (subject: string, index: number): readonly [string, string] => {
if (index < 0) {
return [subject, ''];