11/*!
2- * Wait-for-element-transition v3.0 .0
3- * https://github.com/mkay581/wait-for-element-transition#readme
4- *
5- * Copyright (c) 2018 Mark Kennedy
6- * Licensed under the MIT license
2+ * Wait-for-element-transition v3.1 .0
3+ * https://github.com/mkay581/wait-for-element-transition#readme
4+ *
5+ * Copyright (c) 2020 Mark Kennedy
6+ * Licensed under the MIT license
77 */
88
99/**
@@ -21,7 +21,7 @@ const getCssPropUnitMap = (v) => {
2121 }
2222 return {
2323 num,
24- unit
24+ unit,
2525 } ;
2626} ;
2727/**
@@ -49,7 +49,7 @@ function getTransitionDuration(el) {
4949 */
5050 const getJsPropName = ( cssProp ) => {
5151 // convert to camelCase
52- return cssProp . replace ( / - ( [ a - z ] ) / g, letter => {
52+ return cssProp . replace ( / - ( [ a - z ] ) / g, ( letter ) => {
5353 return letter [ 1 ] . toUpperCase ( ) ;
5454 } ) ;
5555 } ;
@@ -68,7 +68,7 @@ function getTransitionDuration(el) {
6868 let map ;
6969 times . push . apply ( times , delay ) ; // account for delay
7070 // calculate highest number of time
71- times . forEach ( value => {
71+ times . forEach ( ( value ) => {
7272 value . split ( ',' ) . forEach ( ( v ) => {
7373 v = convertCssTimeValueToMilliseconds ( v ) ;
7474 map = getCssPropUnitMap ( v ) ;
@@ -84,7 +84,7 @@ function getTransitionDuration(el) {
8484 */
8585function waitForElementTransition ( el ) {
8686 const duration = getTransitionDuration ( el ) ;
87- return new Promise ( resolve => {
87+ return new Promise ( ( resolve ) => {
8888 if ( duration > 0 ) {
8989 setTimeout ( ( ) => {
9090 resolve ( el ) ;
0 commit comments