@@ -213,12 +213,12 @@ function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: s
213213 return Object . entries ( obj ) . reduce (
214214 ( acc , [ key , ary ] ) => ( {
215215 ...acc ,
216- [ key . replace ( from , to ) ] : ary . map ( ( item ) => {
216+ [ key . replaceAll ( from , to ) ] : ary . map ( ( item ) => {
217217 const transformedItem = { ...item }
218218
219219 for ( const prop of props ) {
220220 if ( prop in item && typeof item [ prop ] === "string" ) {
221- transformedItem [ prop ] = item [ prop ] . replace ( from , to )
221+ transformedItem [ prop ] = item [ prop ] . replaceAll ( from , to )
222222 }
223223 }
224224
@@ -232,7 +232,7 @@ function transformArrayRecord<T>(obj: Record<string, any[]>, from: string, to: s
232232// eslint-disable-next-line @typescript-eslint/no-explicit-any
233233function transformArray < T > ( arr : any [ ] , from : string , to : string , idProp : string ) : T [ ] {
234234 return arr . map ( ( { [ idProp ] : id , ...rest } ) => ( {
235- [ idProp ] : id . replace ( from , to ) ,
235+ [ idProp ] : id . replaceAll ( from , to ) ,
236236 ...rest ,
237237 } ) )
238238}
@@ -242,7 +242,7 @@ function transformRecord<T>(obj: Record<string, any>, from: string, to: string):
242242 return Object . entries ( obj ) . reduce (
243243 ( acc , [ key , value ] ) => ( {
244244 ...acc ,
245- [ key . replace ( from , to ) ] : value ,
245+ [ key . replaceAll ( from , to ) ] : value ,
246246 } ) ,
247247 { } as T ,
248248 )
0 commit comments