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})