🌳
pt0/sharedF/moDashF/replaceStrictF.mts
1import { replace } from 'lodash-es'
4export const replaceStrict = (contents : string, fromStr : string, toStr : string) => {
5 throwIf(() => fromStr == toStr, {contents, fromStr, toStr})
7 const beforeContents = contents
8 contents = replace(contents, fromStr, toStr)
10 throwIf(() => contents == beforeContents, {contents, fromStr, toStr})
12 return contents