Skip to content

Commit 73d2127

Browse files
committed
Add default params values for service functions
1 parent c7d6913 commit 73d2127

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

projects/ngx-diff2html/src/lib/ngx-diff2html.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class NgxDiff2htmlService {
1010

1111
constructor() { }
1212

13-
getDiff(text1: string, text2: string, filename: string) {
13+
getDiff(text1: string, text2: string, filename: string = '') {
1414
// Get diff
1515
const dmp = new diff_match_patch();
1616
const chars = dmp.diff_linesToChars_(text1, text2);
@@ -44,7 +44,7 @@ export class NgxDiff2htmlService {
4444
return diff;
4545
}
4646

47-
diffToHTML(diff: string, format: DiffFormat, style: DiffStyle) {
47+
diffToHTML(diff: string, format: DiffFormat = 'line-by-line', style: DiffStyle = 'word') {
4848
return Diff2Html.getPrettyHtml(diff, {
4949
inputFormat: 'diff',
5050
matching: 'lines',

0 commit comments

Comments
 (0)