globe/src/utility.ts

16 lines
284 B
TypeScript
Raw Normal View History

2022-12-11 10:31:34 +00:00
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);
}