File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,10 +100,10 @@ function deepCopy(
100100
101101 if ( Array . isArray ( value ) ) {
102102 copy = [ ] ;
103- ( value as unknown [ ] ) . forEach ( function ( element : unknown , index : number ) {
103+ ( value as unknown [ ] ) . forEach ( ( element : unknown , index : number ) => {
104104 ( copy as unknown [ ] ) [ index ] = deepCopy (
105105 element ,
106- path + '[' + String ( index ) + ']' ,
106+ ` ${ path } [ ${ index . toString ( ) } ]` ,
107107 visitedObjects ,
108108 replacer ,
109109 ) ;
@@ -115,13 +115,15 @@ function deepCopy(
115115 ) {
116116 ( copy as DecycledObject ) [ key ] = deepCopy (
117117 ( value as Record < string , unknown > ) [ key ] ,
118- path + '[' + JSON . stringify ( key ) + ']' ,
118+ ` ${ path } [ ${ JSON . stringify ( key ) } ]` ,
119119 visitedObjects ,
120120 replacer ,
121121 ) ;
122122 } ) ;
123123 }
124+
124125 return copy ;
125126 }
127+
126128 return value ;
127129}
You can’t perform that action at this time.
0 commit comments