globe/src/utility.ts

16 lines
284 B
TypeScript

export function injectBefore(
text: string,
before: string,
toInsert: string
): string {
return text.replace(before, `${toInsert}${before}`);
}
export function replaceWith(
text: string,
before: string,
after: string
): string {
return text.replace(before, after);
}