@@ -65,7 +65,7 @@ angular.module('diff-match-patch', [])
6565 }
6666 }
6767
68- function diffAttrName ( op ) {
68+ function diffAttributeName ( op ) {
6969 switch ( op ) {
7070 case DIFF_INSERT : {
7171 return 'insert' ;
@@ -81,10 +81,10 @@ angular.module('diff-match-patch', [])
8181 }
8282 }
8383
84- function getTagAttrs ( options , op , attrs ) {
84+ function getTagAttributes ( options , op , attributes ) {
8585 const tagOptions = { } ;
8686 const returnValue = [ ] ;
87- const opName = diffAttrName ( op ) ;
87+ const opName = diffAttributeName ( op ) ;
8888
8989 if ( angular . isDefined ( options ) && angular . isDefined ( options . attrs ) ) {
9090 const attributesFromOptions = options . attrs [ opName ] ;
@@ -93,8 +93,8 @@ angular.module('diff-match-patch', [])
9393 }
9494 }
9595
96- if ( angular . isDefined ( attrs ) ) {
97- angular . merge ( tagOptions , attrs ) ;
96+ if ( angular . isDefined ( attributes ) ) {
97+ angular . merge ( tagOptions , attributes ) ;
9898 }
9999
100100 if ( Object . keys ( tagOptions ) . length === 0 ) {
@@ -111,11 +111,11 @@ angular.module('diff-match-patch', [])
111111 function getHtmlPrefix ( op , display , options ) {
112112 switch ( display ) {
113113 case displayType . LINEDIFF : {
114- return '<div class="' + diffClass ( op ) + '"><span' + getTagAttrs ( options , op , { class : 'noselect' } ) + '>' + diffSymbol ( op ) + '</span>' ;
114+ return '<div class="' + diffClass ( op ) + '"><span' + getTagAttributes ( options , op , { class : 'noselect' } ) + '>' + diffSymbol ( op ) + '</span>' ;
115115 }
116116
117117 default : { // case displayType.INSDEL:
118- return '<' + diffTag ( op ) + getTagAttrs ( options , op ) + '>' ;
118+ return '<' + diffTag ( op ) + getTagAttributes ( options , op ) + '>' ;
119119 }
120120 }
121121 }
@@ -159,7 +159,7 @@ angular.module('diff-match-patch', [])
159159 let intraHtml2 ;
160160
161161 for ( x = 0 ; x < diffData . length ; x ++ ) {
162- diffData [ x ] [ 1 ] = diffData [ x ] [ 1 ] . replace ( / & / g , '&' ) . replace ( / < / g , '<' ) . replace ( / > / g , '>' ) ;
162+ diffData [ x ] [ 1 ] = diffData [ x ] [ 1 ] . replaceAll ( '&' , '&' ) . replaceAll ( '<' , '<' ) . replaceAll ( '>' , '>' ) ;
163163 }
164164
165165 for ( y = 0 ; y < diffData . length ; y ++ ) {
@@ -177,7 +177,7 @@ angular.module('diff-match-patch', [])
177177 } else {
178178 html [ y ] = createHtmlLines ( text , op , options ) ;
179179 }
180- } else if ( typeof excludeOp === ' undefined' || op !== excludeOp ) {
180+ } else if ( excludeOp === undefined || op !== excludeOp ) {
181181 html [ y ] = getHtmlPrefix ( op , display , options ) + text + getHtmlSuffix ( op , display ) ;
182182 }
183183 }
@@ -212,7 +212,7 @@ angular.module('diff-match-patch', [])
212212 const line = text . slice ( lineStart , lineEnd + ( ( ignoreTrailingNewLines && hasNewLine ) ? 0 : 1 ) ) ;
213213 lineStart = lineEnd + 1 ;
214214
215- if ( Object . prototype . hasOwnProperty . call ( lineHash , line ) ) {
215+ if ( Object . hasOwn ( lineHash , line ) ) {
216216 chars += String . fromCharCode ( lineHash [ line ] ) ; // eslint-disable-line unicorn/prefer-code-point
217217 } else {
218218 chars += String . fromCharCode ( lineArrayLength ) ; // eslint-disable-line unicorn/prefer-code-point
0 commit comments