@@ -110,7 +110,7 @@ const getMaxHeight = (element: HTMLElement | Element, clmp: number): number => {
110
110
*/
111
111
const getLineHeight = ( elem : HTMLElement | Element ) : number => {
112
112
const lh = computeStyle ( elem , 'line-height' ) ;
113
- if ( lh == 'normal' ) {
113
+ if ( lh === 'normal' ) {
114
114
// Normal line heights vary from browser to browser. The spec recommends
115
115
// a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.
116
116
return parseInt ( computeStyle ( elem , 'font-size' ) ) * 1.2 ;
@@ -140,7 +140,7 @@ const getLastChild = (elem: HTMLElement | Element, options: IClampOptions): HTML
140
140
! elem . lastChild ||
141
141
! elem . lastChild . nodeValue ||
142
142
elem . lastChild . nodeValue === '' ||
143
- elem . lastChild . nodeValue == options . truncationChar
143
+ elem . lastChild . nodeValue === options . truncationChar
144
144
) {
145
145
elem . lastChild . parentNode . removeChild ( elem . lastChild ) ;
146
146
return getLastChild ( elem , options ) ;
@@ -318,7 +318,7 @@ export function clamp(element: Element | HTMLElement, options?: IClampOptions):
318
318
const sty = ( < HTMLElement > element ) . style ;
319
319
const original = element . innerHTML ;
320
320
const supportsNativeClamp =
321
- typeof ( < HTMLElement > element ) . style . webkitLineClamp != 'undefined' ;
321
+ typeof ( < HTMLElement > element ) . style . webkitLineClamp !== 'undefined' ;
322
322
let clampValue = options . clamp ;
323
323
const isCSSValue =
324
324
( < string > clampValue ) . indexOf &&
@@ -331,7 +331,7 @@ export function clamp(element: Element | HTMLElement, options?: IClampOptions):
331
331
}
332
332
333
333
// CONSTRUCTOR ________________________________________________________________
334
- if ( clampValue == 'auto' ) {
334
+ if ( clampValue === 'auto' ) {
335
335
clampValue = getMaxLines ( element ) ;
336
336
} else if ( isCSSValue ) {
337
337
clampValue = getMaxLines ( element , parseInt ( clampValue as string ) ) ;
0 commit comments