Skip to content

Commit fe51703

Browse files
lusarzeddyerburgh
authored andcommitted
refactor: change method hasClass to use classList.contains method
1 parent b18e37e commit fe51703

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/wrappers/wrapper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,7 @@ export default class Wrapper implements BaseWrapper {
7777
throwError('wrapper.hasClass() must be passed a string')
7878
}
7979

80-
return !!(this.element &&
81-
this.element.className.split(' ').indexOf(className) !== -1)
80+
return !!(this.element && this.element.classList.contains(className))
8281
}
8382

8483
/**

0 commit comments

Comments
 (0)