File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,12 +34,16 @@ const props = withDefaults(defineProps<Props>(), {
3434const isUnifiedViewer = computed (() => props .outputFormat === ' line-by-line' )
3535
3636const oldString = computed (() => {
37- const value = props .trim ? props .oldString .trim () : props .oldString
38- return props .noDiffLineFeed ? value .replace (/ (\r\n )/ g , ' \n ' ) : value
37+ let value = props .oldString || ' '
38+ value = props .trim ? value .trim () : value
39+ value = props .noDiffLineFeed ? value .replace (/ (\r\n )/ g , ' \n ' ) : value
40+ return value
3941})
4042const newString = computed (() => {
41- const value = props .trim ? props .newString .trim () : props .newString
42- return props .noDiffLineFeed ? value .replace (/ (\r\n )/ g , ' \n ' ) : value
43+ let value = props .newString || ' '
44+ value = props .trim ? value .trim () : value
45+ value = props .noDiffLineFeed ? value .replace (/ (\r\n )/ g , ' \n ' ) : value
46+ return value
4347})
4448
4549const raw = computed (() =>
You can’t perform that action at this time.
0 commit comments