@@ -59,8 +59,8 @@ const diffObject = (
59
59
60
60
if ( keyLeft === keyRight ) {
61
61
if ( getType ( lhs [ keyLeft ] ) !== getType ( rhs [ keyRight ] ) ) {
62
- const _resultLeft = formatValue ( lhs [ keyLeft ] ) . split ( '\n' ) ;
63
- const _resultRight = formatValue ( rhs [ keyRight ] ) . split ( '\n' ) ;
62
+ const _resultLeft = formatValue ( lhs [ keyLeft ] , options . maxDepth , true ) . split ( '\n' ) ;
63
+ const _resultRight = formatValue ( rhs [ keyRight ] , options . maxDepth , true ) . split ( '\n' ) ;
64
64
if ( options . showModifications ) {
65
65
const maxLines = Math . max ( _resultLeft . length , _resultRight . length ) ;
66
66
for ( let i = _resultLeft . length ; i < maxLines ; i ++ ) {
@@ -138,17 +138,17 @@ const diffObject = (
138
138
} else {
139
139
if ( lhs [ keyLeft ] !== rhs [ keyRight ] ) {
140
140
if ( options . showModifications ) {
141
- linesLeft . push ( { level, type : 'modify' , text : `"${ keyLeft } ": ${ formatValue ( lhs [ keyLeft ] ) } ` } ) ;
142
- linesRight . push ( { level, type : 'modify' , text : `"${ keyRight } ": ${ formatValue ( rhs [ keyRight ] ) } ` } ) ;
141
+ linesLeft . push ( { level, type : 'modify' , text : `"${ keyLeft } ": ${ formatValue ( lhs [ keyLeft ] , options . maxDepth ) } ` } ) ;
142
+ linesRight . push ( { level, type : 'modify' , text : `"${ keyRight } ": ${ formatValue ( rhs [ keyRight ] , options . maxDepth ) } ` } ) ;
143
143
} else {
144
- linesLeft . push ( { level, type : 'remove' , text : `"${ keyLeft } ": ${ formatValue ( lhs [ keyLeft ] ) } ` } ) ;
144
+ linesLeft . push ( { level, type : 'remove' , text : `"${ keyLeft } ": ${ formatValue ( lhs [ keyLeft ] , options . maxDepth ) } ` } ) ;
145
145
linesLeft . push ( { level, type : 'equal' , text : '' } ) ;
146
146
linesRight . push ( { level, type : 'equal' , text : '' } ) ;
147
- linesRight . push ( { level, type : 'add' , text : `"${ keyRight } ": ${ formatValue ( rhs [ keyRight ] ) } ` } ) ;
147
+ linesRight . push ( { level, type : 'add' , text : `"${ keyRight } ": ${ formatValue ( rhs [ keyRight ] , options . maxDepth ) } ` } ) ;
148
148
}
149
149
} else {
150
- linesLeft . push ( { level, type : 'equal' , text : `"${ keyLeft } ": ${ formatValue ( lhs [ keyLeft ] ) } ` } ) ;
151
- linesRight . push ( { level, type : 'equal' , text : `"${ keyRight } ": ${ formatValue ( rhs [ keyRight ] ) } ` } ) ;
150
+ linesLeft . push ( { level, type : 'equal' , text : `"${ keyLeft } ": ${ formatValue ( lhs [ keyLeft ] , options . maxDepth ) } ` } ) ;
151
+ linesRight . push ( { level, type : 'equal' , text : `"${ keyRight } ": ${ formatValue ( rhs [ keyRight ] , options . maxDepth ) } ` } ) ;
152
152
}
153
153
}
154
154
} else if ( keysLeft . length && keysRight . length ) {
0 commit comments