Skip to content

Commit 2a6689e

Browse files
committed
fix: pass jshint
copied from: josephschmitt/Clamp.js#54
1 parent d77d2ac commit 2a6689e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/clamp.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const getMaxHeight = (element: HTMLElement | Element, clmp: number): number => {
110110
*/
111111
const getLineHeight = (elem: HTMLElement | Element): number => {
112112
const lh = computeStyle(elem, 'line-height');
113-
if (lh == 'normal') {
113+
if (lh === 'normal') {
114114
// Normal line heights vary from browser to browser. The spec recommends
115115
// a value between 1.0 and 1.2 of the font size. Using 1.1 to split the diff.
116116
return parseInt(computeStyle(elem, 'font-size')) * 1.2;
@@ -140,7 +140,7 @@ const getLastChild = (elem: HTMLElement | Element, options: IClampOptions): HTML
140140
!elem.lastChild ||
141141
!elem.lastChild.nodeValue ||
142142
elem.lastChild.nodeValue === '' ||
143-
elem.lastChild.nodeValue == options.truncationChar
143+
elem.lastChild.nodeValue === options.truncationChar
144144
) {
145145
elem.lastChild.parentNode.removeChild(elem.lastChild);
146146
return getLastChild(elem, options);
@@ -318,7 +318,7 @@ export function clamp(element: Element | HTMLElement, options?: IClampOptions):
318318
const sty = (<HTMLElement>element).style;
319319
const original = element.innerHTML;
320320
const supportsNativeClamp =
321-
typeof (<HTMLElement>element).style.webkitLineClamp != 'undefined';
321+
typeof (<HTMLElement>element).style.webkitLineClamp !== 'undefined';
322322
let clampValue = options.clamp;
323323
const isCSSValue =
324324
(<string>clampValue).indexOf &&
@@ -331,7 +331,7 @@ export function clamp(element: Element | HTMLElement, options?: IClampOptions):
331331
}
332332

333333
// CONSTRUCTOR ________________________________________________________________
334-
if (clampValue == 'auto') {
334+
if (clampValue === 'auto') {
335335
clampValue = getMaxLines(element);
336336
} else if (isCSSValue) {
337337
clampValue = getMaxLines(element, parseInt(clampValue as string));

0 commit comments

Comments
 (0)