@thednp/shorty 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/README.md +12 -7
  2. package/dist/shorty.esm.js +379 -312
  3. package/dist/shorty.esm.min.js +2 -2
  4. package/dist/shorty.js +392 -319
  5. package/dist/shorty.min.js +2 -2
  6. package/package.json +11 -2
  7. package/src/attr/getAttribute.js +1 -1
  8. package/src/attr/getAttributeNS.js +1 -1
  9. package/src/attr/hasAttribute.js +1 -1
  10. package/src/attr/hasAttributeNS.js +1 -1
  11. package/src/attr/removeAttribute.js +1 -1
  12. package/src/attr/removeAttributeNS.js +1 -1
  13. package/src/attr/setAttribute.js +1 -1
  14. package/src/attr/setAttributeNS.js +1 -1
  15. package/src/boolean/isApple.js +2 -2
  16. package/src/boolean/isFirefox.js +2 -1
  17. package/src/boolean/isMobile.js +2 -2
  18. package/src/boolean/support3DTransform.js +2 -1
  19. package/src/boolean/supportAnimation.js +2 -1
  20. package/src/boolean/supportPassive.js +1 -1
  21. package/src/boolean/supportTouch.js +2 -1
  22. package/src/boolean/supportTransform.js +2 -1
  23. package/src/boolean/supportTransition.js +2 -1
  24. package/src/class/addClass.js +1 -1
  25. package/src/class/hasClass.js +1 -1
  26. package/src/class/removeClass.js +1 -1
  27. package/src/event/off.js +2 -6
  28. package/src/event/on.js +2 -6
  29. package/src/event/one.js +3 -6
  30. package/src/get/getBoundingClientRect.js +9 -5
  31. package/src/get/getDocument.js +8 -3
  32. package/src/get/getDocumentBody.js +2 -2
  33. package/src/get/getDocumentElement.js +2 -2
  34. package/src/get/getDocumentHead.js +2 -2
  35. package/src/get/getElementAnimationDelay.js +3 -3
  36. package/src/get/getElementAnimationDelayLegacy.js +3 -3
  37. package/src/get/getElementAnimationDuration.js +3 -3
  38. package/src/get/getElementAnimationDurationLegacy.js +3 -3
  39. package/src/get/getElementStyle.js +5 -3
  40. package/src/get/getElementTransitionDelay.js +3 -4
  41. package/src/get/getElementTransitionDelayLegacy.js +3 -3
  42. package/src/get/getElementTransitionDuration.js +3 -3
  43. package/src/get/getElementTransitionDurationLegacy.js +3 -3
  44. package/src/get/getNodeScroll.js +1 -1
  45. package/src/get/getParentNode.js +4 -5
  46. package/src/get/getRectRelativeToOffsetParent.js +7 -5
  47. package/src/get/getUID.js +1 -1
  48. package/src/get/getWindow.js +16 -7
  49. package/src/index.js +10 -6
  50. package/src/is/isArray.js +0 -1
  51. package/src/is/isCustomElement.js +1 -1
  52. package/src/is/isDocument.js +3 -2
  53. package/src/is/isElement.js +14 -1
  54. package/src/is/isElementInScrollRange.js +4 -2
  55. package/src/is/isElementInViewport.js +6 -2
  56. package/src/is/isElementsArray.js +3 -1
  57. package/src/is/isFunction.js +2 -3
  58. package/src/is/isHTMLCollection.js +1 -1
  59. package/src/is/isHTMLElement.js +2 -1
  60. package/src/is/isHTMLImageElement.js +1 -1
  61. package/src/is/isMedia.js +5 -3
  62. package/src/is/isNode.js +2 -1
  63. package/src/is/isNodeList.js +2 -1
  64. package/src/is/isNumber.js +8 -0
  65. package/src/is/isRTL.js +1 -1
  66. package/src/is/isSVGElement.js +4 -1
  67. package/src/is/isScaledElement.js +2 -0
  68. package/src/is/isShadowRoot.js +2 -5
  69. package/src/is/isString.js +2 -2
  70. package/src/is/isTableElement.js +5 -1
  71. package/src/is/isWindow.js +5 -5
  72. package/src/misc/ObjectEntries.js +7 -0
  73. package/src/misc/OriginalEvent.js +2 -1
  74. package/src/misc/createElement.js +3 -1
  75. package/src/misc/createElementNS.js +7 -3
  76. package/src/misc/data.js +16 -16
  77. package/src/misc/dispatchEvent.js +1 -1
  78. package/src/misc/emulateAnimationEnd.js +5 -2
  79. package/src/misc/emulateAnimationEndLegacy.js +9 -6
  80. package/src/misc/emulateTransitionEnd.js +5 -2
  81. package/src/misc/emulateTransitionEndLegacy.js +9 -6
  82. package/src/misc/focus.js +1 -2
  83. package/src/misc/normalizeOptions.js +2 -2
  84. package/src/misc/normalizeValue.js +8 -6
  85. package/src/misc/passiveHandlerLegacy.js +2 -1
  86. package/src/misc/reflow.js +1 -2
  87. package/src/misc/setElementStyle.js +12 -3
  88. package/src/misc/timer.js +16 -19
  89. package/src/misc/version.js +0 -1
  90. package/src/selectors/closest.js +3 -3
  91. package/src/selectors/getCustomElements.js +4 -5
  92. package/src/selectors/getElementById.js +6 -3
  93. package/src/selectors/getElementsByClassName.js +4 -3
  94. package/src/selectors/getElementsByTagName.js +4 -3
  95. package/src/selectors/matches.js +1 -1
  96. package/src/selectors/matchesLegacy.js +8 -8
  97. package/src/selectors/querySelector.js +9 -7
  98. package/src/selectors/querySelectorAll.js +4 -3
  99. package/src/strings/animationDelayLegacy.js +2 -1
  100. package/src/strings/animationDurationLegacy.js +2 -1
  101. package/src/strings/animationEndEventLegacy.js +2 -1
  102. package/src/strings/animationNameLegacy.js +2 -1
  103. package/src/strings/mouseHoverEvents.js +2 -1
  104. package/src/strings/transitionDelayLegacy.js +2 -1
  105. package/src/strings/transitionDurationLegacy.js +2 -1
  106. package/src/strings/transitionEndEventLegacy.js +2 -1
  107. package/src/strings/transitionPropertyLegacy.js +2 -2
  108. package/src/strings/userAgentData.js +0 -1
  109. package/types/index.d.ts +9 -3
  110. package/types/module/shorty.ts +2 -2
  111. package/types/shorty.d.ts +237 -224
  112. package/src/misc/tryWrapper.js +0 -11
  113. package/src/selectors/documentAll.js +0 -8
@@ -1,2 +1,2 @@
1
- // Shorty v1.0.1 | dnp_theme © 2022 | MIT-License
2
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).SHORTY=t()}(this,(function(){"use strict";var e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n=document.head,i="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",o="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",r="webkitAnimation"in n.style?"webkitAnimationName":"animationName",a="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",u="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",s="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",c="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",m=navigator.userAgentData,f=navigator.userAgent,d=/iPhone|iPad|iPod|Android/i,v=m?m.brands.some((function(e){return d.test(e.brand)})):d.test(f),g=/(iPhone|iPod|iPad)/,p=m?m.brands.some((function(e){return g.test(e.brand)})):g.test(f),b=!!f&&f.includes("Firefox"),y="webkitPerspective"in n.style||"perspective"in n.style;function E(e,t,n,i){var o=i||!1;e.addEventListener(t,n,o)}function h(e,t,n,i){var o=i||!1;e.removeEventListener(t,n,o)}function w(e,t,n,i){var o=function(r){r.target===e&&(n.apply(e,[r]),h(e,t,o,i))};E(e,t,o,i)}var A=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0}});w(document,"DOMContentLoaded",(function(){}),t)}catch(e){throw Error("Passive events are not supported")}return e}(),k="webkitTransform"in n.style||"transform"in n.style,L="ontouchstart"in window||"msMaxTouchPoints"in navigator,D="webkitAnimation"in n.style||"animation"in n.style,N="webkitTransition"in n.style||"transition"in n.style,T=function(e,t){return e.getAttribute(t)};function S(e){return e instanceof HTMLElement?e.ownerDocument:e instanceof Window?e.document:window.document}function M(e,t){return"string"==typeof e?("object"!=typeof t?S():t).querySelector(e):e}var O=new Map,C={set:function(e,t,n){var i=M(e);i&&(O.has(t)||O.set(t,new Map),O.get(t).set(i,n))},getAllFor:function(e){return O.get(e)||null},get:function(e,t){var n=M(e),i=C.getAllFor(t);return n&&i&&i.get(n)||null},remove:function(e,t){var n=M(e),i=O.get(t);i&&n&&(i.delete(n),0===i.size&&O.delete(t))}},z=function(e,t){return Object.assign(e,t)};function H(e,t){var n=getComputedStyle(e);return t in n?n[t]:""}function x(e){var t=H(e,"animationName"),n=H(e,"animationDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function I(e){var t=H(e,"animationName"),n=H(e,"animationDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function P(e){var t=H(e,r),n=H(e,o),i=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(a)?0:a}function B(e){var t=H(e,r),n=H(e,i),o=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(a)?0:a}function F(e){var t=H(e,"transitionProperty"),n=H(e,"transitionDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function j(e){var t=H(e,"transitionProperty"),n=H(e,"transitionDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function R(e){var t=H(e,l),n=H(e,s),i=n.includes("ms")?1:1e3,o=N&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function V(e){var t=H(e,l),n=H(e,u),i=n.includes("ms")?1:1e3,o=N&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function W(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}var Q=function(e){return Object.keys(e)},U=function(e){return e.toLowerCase()};var q=!!A&&{passive:!0},G=new Map,K={set:function(e,t,n,i){var o=M(e);o&&(i&&i.length?(G.has(o)||G.set(o,new Map),G.get(o).set(i,setTimeout(t,n))):G.set(o,setTimeout(t,n)))},get:function(e,t){var n=M(e);if(!n)return null;var i=G.get(n);return t&&t.length&&i&&i.get?i.get(t)||null:i||null},clear:function(e,t){var n=M(e);if(n)if(t&&t.length){var i=G.get(n);i&&i.get&&(clearTimeout(i.get(t)),i.delete(t),0===i.size&&G.delete(n))}else clearTimeout(G.get(n)),G.delete(n)}};function X(e,t){var n=e.getBoundingClientRect(),i=n.width,o=n.height,r=n.top,a=n.right,u=n.bottom,s=n.left,c=1,l=1;if(t&&e instanceof HTMLElement){var m=e.offsetWidth,f=e.offsetHeight;c=m>0&&Math.round(i)/m||1,l=f>0&&Math.round(o)/f||1}return{width:i/c,height:o/l,top:r/l,right:a/c,bottom:u/l,left:s/c,x:s/c,y:r/l}}function Y(e){return S(e).documentElement}function Z(e){if(null==e)return window;if(!(e instanceof Window)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}var J=function(e){return e instanceof Z(e).ShadowRoot||e instanceof ShadowRoot};function $(e){var t=X(e),n=t.width,i=t.height,o=e.offsetWidth,r=e.offsetHeight;return Math.round(n)!==o||Math.round(i)!==r}var _=0,ee=0,te=new Map;var ne=function(e){return e&&!!e.shadowRoot};function ie(e,t){return("object"!=typeof t?S():t).getElementsByTagName(e)}var oe=ie("*");var re=Element.prototype,ae=re.matches||re.matchesSelector||re.webkitMatchesSelector||re.mozMatchesSelector||re.msMatchesSelector||re.oMatchesSelector||function(){return!1};return{ariaChecked:"aria-checked",ariaDescription:"aria-description",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaHasPopup:"aria-haspopup",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",ariaValueMin:"aria-valuemin",ariaValueMax:"aria-valuemax",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:i,animationDelay:"animationDelay",animationDelayLegacy:o,animationName:"animationName",animationNameLegacy:r,animationEndEvent:"animationend",animationEndEventLegacy:a,transitionDuration:"transitionDuration",transitionDurationLegacy:u,transitionDelay:"transitionDelay",transitionDelayLegacy:s,transitionEndEvent:"transitionend",transitionEndEventLegacy:c,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:v,isApple:p,isFirefox:b,support3DTransform:y,supportPassive:A,supportTransform:k,supportTouch:L,supportAnimation:D,supportTransition:N,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:m,userAgent:f,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:E,off:h,one:w,dispatchEvent:function(e,t){return e.dispatchEvent(t)},distinct:function(e,t,n){return n.indexOf(e)===t},Data:C,getInstance:function(e,t){return C.get(e,t)},createElement:function e(t){if("string"==typeof t)return S().createElement(t);var n=t.tagName,i=Object.assign({},t),o=e(n);return delete i.tagName,z(o,i),o},createElementNS:function e(t,n){if("string"==typeof n)return S().createElementNS(t,n);var i=n.tagName,o=Object.assign({},n),r=e(t,i);return delete o.tagName,z(r,o),r},toUpperCase:function(e){return e.toUpperCase()},toLowerCase:U,Timer:K,emulateAnimationEnd:function(e,t){var n=0,i=new Event("animationend"),o=I(e),r=x(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("animationend",a),n=1)};e.addEventListener("animationend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateAnimationEndLegacy:function(e,t){var n=0,i=new Event(a),o=B(e),r=P(e);if(D&&o){var u=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(a,u),n=1)};e.addEventListener(a,u),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateTransitionEnd:function(e,t){var n=0,i=new Event("transitionend"),o=j(e),r=F(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("transitionend",a),n=1)};e.addEventListener("transitionend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateTransitionEndLegacy:function(e,t){var n=0,i=new Event(c),o=V(e),r=R(e);if(N&&o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(c,a),n=1)};e.addEventListener(c,a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},isElementInScrollRange:function(e){var t=X(e),n=t.top,i=t.bottom;return n<=Y(e).clientHeight&&i>=0},isElementInViewport:function(e){var t=X(e,!0),n=t.top,i=t.left,o=t.bottom,r=t.right,a=Y(e),u=a.clientWidth,s=a.clientHeight;return n>=0&&i>=0&&o<=s&&r<=u},passiveHandler:{passive:!0},passiveHandlerLegacy:q,getElementAnimationDuration:I,getElementAnimationDurationLegacy:B,getElementAnimationDelay:x,getElementAnimationDelayLegacy:P,getElementTransitionDuration:j,getElementTransitionDurationLegacy:V,getElementTransitionDelay:F,getElementTransitionDelayLegacy:R,getNodeScroll:function(e){var t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(J(e)?e.host:null)||Y(e)},getRectRelativeToOffsetParent:function(e,t,n){var i=t instanceof HTMLElement,o=X(e,i&&$(t)),r={x:0,y:0};if(i){var a=X(t,!0);r.x=a.x+t.clientLeft,r.y=a.y+t.clientTop}return{x:o.left+n.x-r.x,y:o.top+n.y-r.y,width:o.width,height:o.height}},getWindow:Z,isArray:function(e){return Array.isArray(e)},isString:function(e){return"string"==typeof e},isCustomElement:ne,isElement:function(e){return e instanceof Element},isNode:function(e){return e instanceof Node},isHTMLElement:function(e){return e instanceof HTMLElement},isHTMLImageElement:function(e){return e instanceof HTMLImageElement},isSVGElement:function(e){return e instanceof SVGElement},isNodeList:function(e){return e instanceof NodeList},isHTMLCollection:function(e){return e instanceof HTMLCollection},isScaledElement:$,isTableElement:function(e){return["TABLE","TD","TH"].includes(e.tagName)},isShadowRoot:J,isDocument:function(e){return e instanceof Document},isElementsArray:function(e){return Array.isArray(e)&&e.every((function(e){return[HTMLElement,Element].some((function(t){return e instanceof t}))}))},isWindow:function(e){return e instanceof Window},isMedia:function(e){return e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some((function(t){return e instanceof t}))},isRTL:function(e){return"rtl"===Y(e).dir},closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},documentAll:oe,querySelector:M,getCustomElements:function(e){var t=e&&"object"==typeof e?ie("*",e):oe;return[].concat(t).filter(ne)},getElementById:function(e){return S().getElementById(e)},querySelectorAll:function(e,t){return("object"!=typeof t?S():t).querySelectorAll(e)},getElementsByClassName:function(e,t){return("object"!=typeof t?S():t).getElementsByClassName(e)},getElementsByTagName:ie,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return ae.call(e,t)},normalizeValue:W,normalizeOptions:function(e,t,n,i){var o=Object.assign({},e.dataset),r={},a={};return Q(o).forEach((function(e){var t=i&&e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return U(e)})):e;a[t]=W(o[e])})),Q(n).forEach((function(e){n[e]=W(n[e])})),Q(t).forEach((function(i){r[i]=i in n?n[i]:i in a?a[i]:"title"===i?T(e,"title"):t[i]})),r},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(t+" "+e)}},reflow:function(e){return e.offsetHeight},noop:function(){},focus:function(e){return e.focus()},getUID:function e(t,n){var i=n?_:ee;if(n){var o=e(t),r=te.get(o)||new Map;te.has(o)||te.set(o,r),r.has(n)?i=r.get(n):(r.set(n,i),_+=1)}else{var a=t.id||t;te.has(a)?i=te.get(a):(te.set(a,i),ee+=1)}return i},ArrayFrom:function(e){return Array.from(e)},Float32ArrayFrom:function(e){return Float32Array.from(Array.from(e))},Float64ArrayFrom:function(e){return Float64Array.from(Array.from(e))},ObjectAssign:z,ObjectKeys:Q,ObjectValues:function(e){return Object.values(e)},OriginalEvent:function(e,t){var n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&z(n,t),n},getBoundingClientRect:X,getDocument:S,getDocumentBody:function(e){return S(e).body},getDocumentElement:Y,getDocumentHead:function(e){return S(e).head},getElementStyle:H,setElementStyle:function(e,t){z(e.style,t)},hasAttribute:function(e,t){return e.hasAttribute(t)},hasAttributeNS:function(e,t,n){return t.hasAttributeNS(e,n)},getAttribute:T,getAttributeNS:function(e,t,n){return t.getAttributeNS(e,n)},setAttribute:function(e,t,n){return e.setAttribute(t,n)},setAttributeNS:function(e,t,n,i){return t.setAttributeNS(e,n,i)},removeAttribute:function(e,t){return e.removeAttribute(t)},removeAttributeNS:function(e,t,n){return t.removeAttributeNS(e,n)},Version:"1.0.1"}}));
1
+ // Shorty v1.0.2 | dnp_theme © 2022 | MIT-License
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).SHORTY=t()}(this,(function(){"use strict";var e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n=document.head,r="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",i="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",o="webkitAnimation"in n.style?"webkitAnimationName":"animationName",a="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",u="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",s="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",c="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",m=navigator.userAgentData,d=navigator.userAgent,f=/iPhone|iPad|iPod|Android/i,v=m?m.brands.some((function(e){return f.test(e.brand)})):f.test(d),g=/(iPhone|iPod|iPad)/,p=m?m.brands.some((function(e){return g.test(e.brand)})):g.test(d),b=!!d&&d.includes("Firefox"),y="webkitPerspective"in n.style||"perspective"in n.style;function E(e,t,n,r){var i=r||!1;e.addEventListener(t,n,i)}function h(e,t,n,r){var i=r||!1;e.removeEventListener(t,n,i)}function w(e,t,n,r){var i=function(o){o.target===e&&(n.apply(e,[o]),h(e,t,i,r))};E(e,t,i,r)}var k=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0}});w(document,"DOMContentLoaded",(function(){}),t)}catch(e){}return e}(),A="webkitTransform"in n.style||"transform"in n.style,L="ontouchstart"in window||"msMaxTouchPoints"in navigator,D="webkitAnimation"in n.style||"animation"in n.style,N="webkitTransition"in n.style||"transition"in n.style,T=function(e,t){return e.getAttribute(t)},S=function(e,t,n){return e.setAttribute(t,n)};var M=function(e){return e&&1===e.nodeType||!1},O=new Map,C={set:function(e,t,n){M(e)&&(O.has(t)||O.set(t,new Map),O.get(t).set(e,n))},getAllFor:function(e){return O.get(e)||null},get:function(e,t){if(!M(e)||!t)return null;var n=C.getAllFor(t);return e&&n&&n.get(e)||null},remove:function(e,t){var n=O.get(t);n&&M(e)&&(n.delete(e),0===n.size&&O.delete(t))}},z=function(e){return e&&9===e.nodeType||!1},x=function(e){return e&&[1,2,3,4,5,6,7,8,9,10,11].some((function(t){return+e.nodeType===t}))||!1},I=function(e){return e&&"Window"===e.constructor.name||!1};function P(e){return z(e)?e:x(e)?e.ownerDocument:I(e)?e.document:window.document}var H=function(e,t){return Object.assign(e,t)};var F=function(e){return Object.entries(e)};var B=function(e,t){return e.dispatchEvent(t)};function R(e,t){var n=getComputedStyle(e);return t.includes("--")?n.getPropertyValue(t):n[t]}function V(e){var t=R(e,"animationName"),n=R(e,"animationDelay"),r=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(i)?0:i}function j(e){var t=R(e,"animationName"),n=R(e,"animationDuration"),r=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(i)?0:i}function W(e){var t=R(e,o),n=R(e,i),r=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(a)?0:a}function Q(e){var t=R(e,o),n=R(e,r),i=n.includes("ms")?1:1e3,a=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(a)?0:a}function U(e){var t=R(e,"transitionProperty"),n=R(e,"transitionDelay"),r=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(i)?0:i}function q(e){var t=R(e,"transitionProperty"),n=R(e,"transitionDuration"),r=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(i)?0:i}function G(e){var t=R(e,l),n=R(e,s),r=n.includes("ms")?1:1e3,i=N&&t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(i)?0:i}function K(e){var t=R(e,l),n=R(e,u),r=n.includes("ms")?1:1e3,i=N&&t&&"none"!==t?parseFloat(n)*r:0;return Number.isNaN(i)?0:i}function X(e){return!!["true",!0].includes(e)||!["false",!1].includes(e)&&(""===e||"null"===e?null:""===e||Number.isNaN(+e)?e:+e)}var Y=function(e){return Object.keys(e)},Z=function(e){return e.toLowerCase()};var J=!!k&&{passive:!0},$=new Map,_={set:function(e,t,n,r){M(e)&&(r&&r.length?($.has(e)||$.set(e,new Map),$.get(e).set(r,setTimeout(t,n))):$.set(e,setTimeout(t,n)))},get:function(e,t){if(!M(e))return null;var n=$.get(e);return t&&t.length&&n&&n.get?n.get(t)||null:n||null},clear:function(e,t){if(M(e))if(t&&t.length){var n=$.get(e);n&&n.get&&(clearTimeout(n.get(t)),n.delete(t),0===n.size&&$.delete(e))}else clearTimeout($.get(e)),$.delete(e)}};function ee(e,t){var n=e.getBoundingClientRect(),r=n.width,i=n.height,o=n.top,a=n.right,u=n.bottom,s=n.left,c=1,l=1;if(t&&M(e)){var m=e.offsetWidth,d=e.offsetHeight;c=m>0?Math.round(r)/m:1,l=d>0?Math.round(i)/d:1}return{width:r/c,height:i/l,top:o/l,right:a/c,bottom:u/l,left:s/c,x:s/c,y:o/l}}function te(e){return P(e).documentElement}var ne=function(e){return e&&"ShadowRoot"===e.constructor.name||!1};function re(e){if(!e||!M(e))return!1;var t=ee(e),n=t.width,r=t.height,i=e.offsetWidth,o=e.offsetHeight;return Math.round(n)!==i||Math.round(r)!==o}var ie=0,oe=0,ae=new Map;function ue(e){return e?z(e)?e.defaultView:x(e)?e.ownerDocument.defaultView:e:window}var se=function(e){return e&&!!e.shadowRoot||!1};function ce(e,t){return(x(t)?t:P()).getElementsByTagName(e)}var le=Element.prototype,me=le.matches||le.matchesSelector||le.webkitMatchesSelector||le.mozMatchesSelector||le.msMatchesSelector||le.oMatchesSelector||function(){return!1};return{ariaChecked:"aria-checked",ariaDescription:"aria-description",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaHasPopup:"aria-haspopup",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",ariaValueMin:"aria-valuemin",ariaValueMax:"aria-valuemax",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:r,animationDelay:"animationDelay",animationDelayLegacy:i,animationName:"animationName",animationNameLegacy:o,animationEndEvent:"animationend",animationEndEventLegacy:a,transitionDuration:"transitionDuration",transitionDurationLegacy:u,transitionDelay:"transitionDelay",transitionDelayLegacy:s,transitionEndEvent:"transitionend",transitionEndEventLegacy:c,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:v,isApple:p,isFirefox:b,support3DTransform:y,supportPassive:k,supportTransform:A,supportTouch:L,supportAnimation:D,supportTransition:N,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:m,userAgent:d,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:E,off:h,one:w,dispatchEvent:B,distinct:function(e,t,n){return n.indexOf(e)===t},Data:C,getInstance:function(e,t){return C.get(e,t)},createElement:function e(t){if(!t)return null;if("string"==typeof t)return P().createElement(t);var n=t.tagName,r=Object.assign({},t),i=e(n);return delete r.tagName,H(i,r),i},createElementNS:function e(t,n){if(!t&&!n)return null;if("string"==typeof n)return P().createElementNS(t,n);var r=n.tagName,i=Object.assign({},n),o=e(t,r);return delete i.tagName,F(i).forEach((function(e){var t=e[0],n=e[1];S(o,t,n)})),o},toUpperCase:function(e){return e.toUpperCase()},toLowerCase:Z,Timer:_,emulateAnimationEnd:function(e,t){var n=0,r=new Event("animationend"),i=j(e),o=V(e);if(i){var a=function(r){r.target===e&&(t.apply(e,[r]),e.removeEventListener("animationend",a),n=1)};e.addEventListener("animationend",a),setTimeout((function(){n||B(e,r)}),i+o+17)}else t.apply(e,[r])},emulateAnimationEndLegacy:function(e,t){var n=0,r=new Event(a),i=Q(e),o=W(e);if(D&&i){var u=function(r){r.target===e&&(t.apply(e,[r]),e.removeEventListener(a,u),n=1)};e.addEventListener(a,u),setTimeout((function(){n||B(e,r)}),i+o+17)}else t.apply(e,[r])},emulateTransitionEnd:function(e,t){var n=0,r=new Event("transitionend"),i=q(e),o=U(e);if(i){var a=function(r){r.target===e&&(t.apply(e,[r]),e.removeEventListener("transitionend",a),n=1)};e.addEventListener("transitionend",a),setTimeout((function(){n||B(e,r)}),i+o+17)}else t.apply(e,[r])},emulateTransitionEndLegacy:function(e,t){var n=0,r=new Event(c),i=K(e),o=G(e);if(N&&i){var a=function(r){r.target===e&&(t.apply(e,[r]),e.removeEventListener(c,a),n=1)};e.addEventListener(c,a),setTimeout((function(){n||B(e,r)}),i+o+17)}else t.apply(e,[r])},isElementInScrollRange:function(e){if(!e||!x(e))return!1;var t=ee(e),n=t.top,r=t.bottom;return n<=te(e).clientHeight&&r>=0},isElementInViewport:function(e){if(!e||!x(e))return!1;var t=te(e),n=t.clientWidth,r=t.clientHeight,i=ee(e,!0),o=i.top,a=i.left,u=i.bottom,s=i.right;return o>=0&&a>=0&&u<=r&&s<=n},passiveHandler:{passive:!0},passiveHandlerLegacy:J,getElementAnimationDuration:j,getElementAnimationDurationLegacy:Q,getElementAnimationDelay:V,getElementAnimationDelayLegacy:W,getElementTransitionDuration:q,getElementTransitionDurationLegacy:K,getElementTransitionDelay:U,getElementTransitionDelayLegacy:G,getNodeScroll:function(e){var t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||ne(e)&&e.host||te(e)},getRectRelativeToOffsetParent:function(e,t,n){var r=M(t),i=ee(e,r&&re(t)),o={x:0,y:0};if(r){var a=ee(t,!0);o.x=a.x+t.clientLeft,o.y=a.y+t.clientTop}return{x:i.left+n.x-o.x,y:i.top+n.y-o.y,width:i.width,height:i.height}},getWindow:ue,isArray:function(e){return Array.isArray(e)},isString:function(e){return"string"==typeof e},isCustomElement:se,isElement:function(e){return e&&[1,2,3,4,5,6,7,8].some((function(t){return e.nodeType===t}))||!1},isNode:x,isNumber:function(e){return"number"==typeof e},isHTMLElement:M,isHTMLImageElement:function(e){return e&&"IMG"===e.tagName||!1},isSVGElement:function(e){return e&&e instanceof ue(e).SVGElement||!1},isNodeList:function(e){return e&&"NodeList"===e.constructor.name||!1},isHTMLCollection:function(e){return e&&"HTMLCollection"===e.constructor.name||!1},isScaledElement:re,isTableElement:function(e){return e&&["TABLE","TD","TH"].includes(e.tagName)||!1},isShadowRoot:ne,isDocument:z,isElementsArray:function(e){return Array.isArray(e)&&e.every(M)},isFunction:function(e){return e&&"Function"===e.constructor.name||!1},isWindow:I,isMedia:function(e){return e&&1===e.nodeType&&["SVG","Image","Video"].some((function(t){return e.constructor.name.includes(t)}))||!1},isRTL:function(e){return"rtl"===te(e).dir},closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},querySelector:function(e,t){return x(e)?e:(x(t)?t:P()).querySelector(e)},getCustomElements:function(e){var t=ce("*",e);return[].concat(t).filter(se)},getElementById:function(e,t){return P(t).getElementById(e)},querySelectorAll:function(e,t){return(x(t)?t:P()).querySelectorAll(e)},getElementsByClassName:function(e,t){return(x(t)?t:P()).getElementsByClassName(e)},getElementsByTagName:ce,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return me.call(e,t)},normalizeValue:X,normalizeOptions:function(e,t,n,r){var i=Object.assign({},e.dataset),o={},a={};return Y(i).forEach((function(e){var t=r&&e.includes(r)?e.replace(r,"").replace(/[A-Z]/,(function(e){return Z(e)})):e;a[t]=X(i[e])})),Y(n).forEach((function(e){n[e]=X(n[e])})),Y(t).forEach((function(r){o[r]=r in n?n[r]:r in a?a[r]:"title"===r?T(e,"title"):t[r]})),o},reflow:function(e){return e.offsetHeight},noop:function(){},focus:function(e){return e.focus()},getUID:function e(t,n){var r=n?ie:oe;if(n){var i=e(t),o=ae.get(i)||new Map;ae.has(i)||ae.set(i,o),o.has(n)?r=o.get(n):(o.set(n,r),ie+=1)}else{var a=t.id||t;ae.has(a)?r=ae.get(a):(ae.set(a,r),oe+=1)}return r},ArrayFrom:function(e){return Array.from(e)},Float32ArrayFrom:function(e){return Float32Array.from(Array.from(e))},Float64ArrayFrom:function(e){return Float64Array.from(Array.from(e))},ObjectAssign:H,ObjectEntries:F,ObjectKeys:Y,ObjectValues:function(e){return Object.values(e)},OriginalEvent:function(e,t){var n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&H(n,t),n},getBoundingClientRect:ee,getDocument:P,getDocumentBody:function(e){return P(e).body},getDocumentElement:te,getDocumentHead:function(e){return P(e).head},getElementStyle:R,setElementStyle:function(e,t){F(t).forEach((function(t){var n=t[0],r=t[1];if(n.includes("--"))e.style.setProperty(n,r);else{var i={};i[n]=r,H(e.style,i)}}))},hasAttribute:function(e,t){return e.hasAttribute(t)},hasAttributeNS:function(e,t,n){return t.hasAttributeNS(e,n)},getAttribute:T,getAttributeNS:function(e,t,n){return t.getAttributeNS(e,n)},setAttribute:S,setAttributeNS:function(e,t,n,r){return t.setAttributeNS(e,n,r)},removeAttribute:function(e,t){return e.removeAttribute(t)},removeAttributeNS:function(e,t,n){return t.removeAttributeNS(e,n)},Version:"1.0.2"}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thednp/shorty",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "ES6 JavaScript shorties",
5
5
  "main": "dist/shorty.min.js",
6
6
  "module": "dist/shorty.esm.js",
@@ -12,7 +12,9 @@
12
12
  "types"
13
13
  ],
14
14
  "scripts": {
15
- "test": "echo \"Error: no test specified\" && exit 1",
15
+ "test": "npx cypress run",
16
+ "cypress": "npx cypress open",
17
+ "coverage:report": "nyc report --reporter=lcov --reporter=json --reporter=text --reporter=json-summary",
16
18
  "fix:js": "eslint src/ --config .eslintrc --fix",
17
19
  "lint:js": "eslint src/ --config .eslintrc",
18
20
  "build:ts": "tsc -d",
@@ -43,14 +45,21 @@
43
45
  },
44
46
  "homepage": "https://github.com/thednp/shorty",
45
47
  "devDependencies": {
48
+ "@bahmutov/cypress-esbuild-preprocessor": "^2.1.3",
49
+ "@cypress/code-coverage": "^3.9.12",
46
50
  "@rollup/plugin-buble": "^0.21.3",
47
51
  "@rollup/plugin-json": "^4.1.0",
48
52
  "@rollup/plugin-node-resolve": "^7.1.0",
49
53
  "@rollup/plugin-typescript": "^8.3.0",
54
+ "cypress": "^9.7.0",
55
+ "esbuild": "^0.14.30",
50
56
  "eslint": "^7.22.0",
51
57
  "eslint-config-airbnb-base": "^14.2.1",
52
58
  "eslint-plugin-import": "^2.22.1",
53
59
  "eslint-plugin-vue": "^7.7.0",
60
+ "istanbul-lib-coverage": "^3.2.0",
61
+ "istanbul-lib-instrument": "^5.2.0",
62
+ "nyc": "^15.1.0",
54
63
  "npm-run-all": "^4.1.5",
55
64
  "rollup": "^2.38.5",
56
65
  "rollup-plugin-terser": "^5.3.1",
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Shortcut for `HTMLElement.getAttribute()` method.
3
- * @param {HTMLElement | Element} element target element
3
+ * @param {HTMLElement} element target element
4
4
  * @param {string} attribute attribute name
5
5
  * @returns {string?} attribute value
6
6
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shortcut for `HTMLElement.getAttributeNS()` method.
3
3
  * @param {string} ns attribute namespace
4
- * @param {HTMLElement | Element} element target element
4
+ * @param {HTMLElement} element target element
5
5
  * @param {string} attribute attribute name
6
6
  * @returns {string?} attribute value
7
7
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Shortcut for `HTMLElement.hasAttribute()` method.
3
- * @param {HTMLElement | Element} element target element
3
+ * @param {HTMLElement} element target element
4
4
  * @param {string} attribute attribute name
5
5
  * @returns {boolean} the query result
6
6
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shortcut for `HTMLElement.hasAttributeNS()` method.
3
3
  * @param {string} ns attribute namespace
4
- * @param {HTMLElement | Element} element target element
4
+ * @param {HTMLElement} element target element
5
5
  * @param {string} att attribute name
6
6
  * @returns {boolean} the query result
7
7
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Shortcut for `HTMLElement.removeAttribute()` method.
3
- * @param {HTMLElement | Element} element target element
3
+ * @param {HTMLElement} element target element
4
4
  * @param {string} attribute attribute name
5
5
  * @returns {void}
6
6
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shortcut for `HTMLElement.removeAttributeNS()` method.
3
3
  * @param {string} ns attribute namespace
4
- * @param {HTMLElement | Element} element target element
4
+ * @param {HTMLElement} element target element
5
5
  * @param {string} att attribute name
6
6
  * @returns {void}
7
7
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Shortcut for `HTMLElement.setAttribute()` method.
3
- * @param {HTMLElement | Element} element target element
3
+ * @param {HTMLElement} element target element
4
4
  * @param {string} attribute attribute name
5
5
  * @param {string} value attribute value
6
6
  * @returns {void}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Shortcut for `SVGElement.setAttributeNS()` method.
3
3
  * @param {string} ns attribute namespace
4
- * @param {HTMLElement | Element} element target element
4
+ * @param {HTMLElement} element target element
5
5
  * @param {string} att attribute name
6
6
  * @param {string} value attribute value
7
7
  * @returns {void}
@@ -7,7 +7,7 @@ const appleBrands = /(iPhone|iPod|iPad)/;
7
7
  * A global `boolean` for Apple browsers.
8
8
  * @type {boolean}
9
9
  */
10
- const isApple = !userAgentData ? appleBrands.test(userAgent)
11
- : userAgentData.brands.some((/** @type {Record<string, any>} */x) => appleBrands.test(x.brand));
10
+ const isApple = userAgentData ? userAgentData.brands.some((x) => appleBrands.test(x.brand))
11
+ : /* istanbul ignore next */appleBrands.test(userAgent);
12
12
 
13
13
  export default isApple;
@@ -5,5 +5,6 @@ import userAgent from '../strings/userAgent';
5
5
  * Gecko was not supporting `userAgentData`.
6
6
  * @type {boolean}
7
7
  */
8
- const isFirefox = userAgent ? userAgent.includes('Firefox') : false;
8
+ const isFirefox = userAgent ? userAgent.includes('Firefox')
9
+ : /* istanbul ignore next */false;
9
10
  export default isFirefox;
@@ -4,9 +4,9 @@ import userAgent from '../strings/userAgent';
4
4
  const mobileBrands = /iPhone|iPad|iPod|Android/i;
5
5
  let isMobileCheck = false;
6
6
 
7
+ /* istanbul ignore else */
7
8
  if (userAgentData) {
8
- isMobileCheck = userAgentData.brands
9
- .some((/** @type {Record<String, any>} */x) => mobileBrands.test(x.brand));
9
+ isMobileCheck = userAgentData.brands.some((x) => mobileBrands.test(x.brand));
10
10
  } else {
11
11
  isMobileCheck = mobileBrands.test(userAgent);
12
12
  }
@@ -4,5 +4,6 @@ import documentHead from '../blocks/documentHead';
4
4
  * A global `boolean` for CSS3 3D transform support.
5
5
  * @type {boolean}
6
6
  */
7
- const support3DTransform = 'webkitPerspective' in documentHead.style || 'perspective' in documentHead.style;
7
+ const support3DTransform = 'webkitPerspective' in documentHead.style
8
+ || /* istanbul ignore next */'perspective' in documentHead.style;
8
9
  export default support3DTransform;
@@ -4,5 +4,6 @@ import documentHead from '../blocks/documentHead';
4
4
  * A global `boolean` for CSS3 animation support.
5
5
  * @type {boolean}
6
6
  */
7
- const supportAnimation = 'webkitAnimation' in documentHead.style || 'animation' in documentHead.style;
7
+ const supportAnimation = 'webkitAnimation' in documentHead.style
8
+ || /* istanbul ignore next */'animation' in documentHead.style;
8
9
  export default supportAnimation;
@@ -19,7 +19,7 @@ const supportPassive = (() => {
19
19
  });
20
20
  one(document, DOMContentLoadedEvent, () => {}, opts);
21
21
  } catch (e) {
22
- throw Error('Passive events are not supported');
22
+ // throw Error('Passive events are not supported');
23
23
  }
24
24
 
25
25
  return result;
@@ -2,5 +2,6 @@
2
2
  * A global `boolean` for touch events support.
3
3
  * @type {boolean}
4
4
  */
5
- const supportTouch = 'ontouchstart' in window || 'msMaxTouchPoints' in navigator;
5
+ const supportTouch = 'ontouchstart' in window
6
+ || /* istanbul ignore next */'msMaxTouchPoints' in navigator;
6
7
  export default supportTouch;
@@ -4,5 +4,6 @@ import documentHead from '../blocks/documentHead';
4
4
  * A global `boolean` for CSS3 transform support.
5
5
  * @type {boolean}
6
6
  */
7
- const supportTransform = 'webkitTransform' in documentHead.style || 'transform' in documentHead.style;
7
+ const supportTransform = 'webkitTransform' in documentHead.style
8
+ || /* istanbul ignore next */'transform' in documentHead.style;
8
9
  export default supportTransform;
@@ -4,5 +4,6 @@ import documentHead from '../blocks/documentHead';
4
4
  * A global `boolean` for CSS3 transition support.
5
5
  * @type {boolean}
6
6
  */
7
- const supportTransition = 'webkitTransition' in documentHead.style || 'transition' in documentHead.style;
7
+ const supportTransition = 'webkitTransition' in documentHead.style
8
+ || /* istanbul ignore next */'transition' in documentHead.style;
8
9
  export default supportTransition;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Add class to `HTMLElement.classList`.
3
3
  *
4
- * @param {HTMLElement | Element} element target
4
+ * @param {HTMLElement} element target
5
5
  * @param {string} classNAME to add
6
6
  * @returns {void}
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Check class in `HTMLElement.classList`.
3
3
  *
4
- * @param {HTMLElement | Element} element target
4
+ * @param {HTMLElement} element target
5
5
  * @param {string} classNAME to check
6
6
  * @returns {boolean}
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Remove class from `HTMLElement.classList`.
3
3
  *
4
- * @param {HTMLElement | Element} element target
4
+ * @param {HTMLElement} element target
5
5
  * @param {string} classNAME to remove
6
6
  * @returns {void}
7
7
  */
package/src/event/off.js CHANGED
@@ -1,11 +1,7 @@
1
1
  /**
2
- * Remove eventListener from an `Element` | `HTMLElement` | `Document` | `Window` target.
2
+ * Remove eventListener from an `HTMLElement` | `Document` | `Window` target.
3
3
  *
4
- * @param {HTMLElement | Element | Document | Window} element event.target
5
- * @param {string} eventName event.type
6
- * @param {EventListener} listener callback
7
- * @param {(EventListenerOptions | boolean)=} options other event options
8
- * @returns {void}
4
+ * @type {SHORTY.OnOff<EventTarget>}
9
5
  */
10
6
  export default function off(element, eventName, listener, options) {
11
7
  const ops = options || false;
package/src/event/on.js CHANGED
@@ -1,11 +1,7 @@
1
1
  /**
2
- * Add eventListener to an `Element` | `HTMLElement` | `Document` target.
2
+ * Add eventListener to an `HTMLElement` | `Document` target.
3
3
  *
4
- * @param {HTMLElement | Element | Document | Window} element event.target
5
- * @param {string} eventName event.type
6
- * @param {EventListener} listener callback
7
- * @param {(EventListenerOptions | boolean)=} options other event options
8
- * @returns {void}
4
+ * @type {SHORTY.OnOff<EventTarget>}
9
5
  */
10
6
  export default function on(element, eventName, listener, options) {
11
7
  const ops = options || false;
package/src/event/one.js CHANGED
@@ -2,14 +2,10 @@ import on from './on';
2
2
  import off from './off';
3
3
 
4
4
  /**
5
- * Add an `eventListener` to an `Element` | `HTMLElement` | `Document` | `Window`
5
+ * Add an `eventListener` to an `HTMLElement` | `Document` | `Window`
6
6
  * target and remove it once callback is called.
7
7
  *
8
- * @param {HTMLElement | Element | Document | Window} element event.target
9
- * @param {string} eventName event.type
10
- * @param {EventListener} listener callback
11
- * @param {(EventListenerOptions | boolean)=} options other event options
12
- * @returns {void}
8
+ * @type {SHORTY.OnOff<EventTarget>}
13
9
  */
14
10
  export default function one(element, eventName, listener, options) {
15
11
  /**
@@ -17,6 +13,7 @@ export default function one(element, eventName, listener, options) {
17
13
  * @type {EventListener}
18
14
  */
19
15
  const handlerWrapper = (e) => {
16
+ /* istanbul ignore else */
20
17
  if (e.target === element) {
21
18
  listener.apply(element, [e]);
22
19
  off(element, eventName, handlerWrapper, options);
@@ -1,11 +1,13 @@
1
+ import isHTMLElement from '../is/isHTMLElement';
2
+
1
3
  /**
2
4
  * Returns the bounding client rect of a target `HTMLElement`.
3
5
  *
4
6
  * @see https://github.com/floating-ui/floating-ui
5
7
  *
6
- * @param {HTMLElement | Element} element event.target
8
+ * @param {HTMLElement} element event.target
7
9
  * @param {boolean=} includeScale when *true*, the target scale is also computed
8
- * @returns {SHORTER.BoundingClientRect} the bounding client rect object
10
+ * @returns {SHORTY.BoundingClientRect} the bounding client rect object
9
11
  */
10
12
  export default function getBoundingClientRect(element, includeScale) {
11
13
  const {
@@ -14,10 +16,12 @@ export default function getBoundingClientRect(element, includeScale) {
14
16
  let scaleX = 1;
15
17
  let scaleY = 1;
16
18
 
17
- if (includeScale && element instanceof HTMLElement) {
19
+ if (includeScale && isHTMLElement(element)) {
18
20
  const { offsetWidth, offsetHeight } = element;
19
- scaleX = offsetWidth > 0 ? Math.round(width) / offsetWidth || 1 : 1;
20
- scaleY = offsetHeight > 0 ? Math.round(height) / offsetHeight || 1 : 1;
21
+ scaleX = offsetWidth > 0 ? Math.round(width) / offsetWidth
22
+ : /* istanbul ignore next */1;
23
+ scaleY = offsetHeight > 0 ? Math.round(height) / offsetHeight
24
+ : /* istanbul ignore next */1;
21
25
  }
22
26
 
23
27
  return {
@@ -1,11 +1,16 @@
1
+ import isDocument from '../is/isDocument';
2
+ import isNode from '../is/isNode';
3
+ import isWindow from '../is/isWindow';
4
+
1
5
  /**
2
6
  * Returns the `document` or the `#document` element.
3
7
  * @see https://github.com/floating-ui/floating-ui
4
- * @param {(Node | HTMLElement | Element | globalThis)=} node
8
+ * @param {(ParentNode | Window)=} node
5
9
  * @returns {Document}
6
10
  */
7
11
  export default function getDocument(node) {
8
- if (node instanceof HTMLElement) return node.ownerDocument;
9
- if (node instanceof Window) return node.document;
12
+ if (isDocument(node)) return node;
13
+ if (isNode(node)) return node.ownerDocument;
14
+ if (isWindow(node)) return node.document;
10
15
  return window.document;
11
16
  }
@@ -2,8 +2,8 @@ import getDocument from './getDocument';
2
2
  /**
3
3
  * Returns the `document.body` or the `<body>` element.
4
4
  *
5
- * @param {(Node | HTMLElement | Element | globalThis)=} node
6
- * @returns {HTMLElement | HTMLBodyElement}
5
+ * @param {(ParentNode | Window)=} node
6
+ * @returns {HTMLBodyElement}
7
7
  */
8
8
  export default function getDocumentBody(node) {
9
9
  return getDocument(node).body;
@@ -3,8 +3,8 @@ import getDocument from './getDocument';
3
3
  /**
4
4
  * Returns the `document.documentElement` or the `<html>` element.
5
5
  *
6
- * @param {(Node | HTMLElement | Element | globalThis)=} node
7
- * @returns {HTMLElement | HTMLHtmlElement}
6
+ * @param {(ParentNode | Window)=} node
7
+ * @returns {HTMLHtmlElement}
8
8
  */
9
9
  export default function getDocumentElement(node) {
10
10
  return getDocument(node).documentElement;
@@ -2,8 +2,8 @@ import getDocument from './getDocument';
2
2
  /**
3
3
  * Returns the `document.head` or the `<head>` element.
4
4
  *
5
- * @param {(Node | HTMLElement | Element | globalThis)=} node
6
- * @returns {HTMLElement | HTMLHeadElement}
5
+ * @param {(ParentNode | Window)=} node
6
+ * @returns {HTMLHeadElement}
7
7
  */
8
8
  export default function getDocumentHead(node) {
9
9
  return getDocument(node).head;
@@ -6,16 +6,16 @@ import getElementStyle from './getElementStyle';
6
6
  * Utility to get the computed `animationDelay`
7
7
  * from Element in miliseconds.
8
8
  *
9
- * @param {HTMLElement | Element} element target
9
+ * @param {HTMLElement} element target
10
10
  * @return {number} the value in miliseconds
11
11
  */
12
12
  export default function getElementAnimationDelay(element) {
13
13
  const propertyValue = getElementStyle(element, animationName);
14
14
  const durationValue = getElementStyle(element, animationDelay);
15
-
16
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
15
+ const durationScale = durationValue.includes('ms') ? /* istanbul ignore next */1 : 1000;
17
16
  const duration = propertyValue && propertyValue !== 'none'
18
17
  ? parseFloat(durationValue) * durationScale : 0;
19
18
 
19
+ /* istanbul ignore next */
20
20
  return !Number.isNaN(duration) ? duration : 0;
21
21
  }
@@ -7,15 +7,15 @@ import getElementStyle from './getElementStyle';
7
7
  * Utility to get the computed `animationDelay`
8
8
  * from Element in miliseconds.
9
9
  *
10
- * @param {HTMLElement | Element} element target
10
+ * @param {HTMLElement} element target
11
11
  * @return {number} the value in miliseconds
12
12
  */
13
13
  export default function getElementAnimationDelay(element) {
14
14
  const propertyValue = getElementStyle(element, animationName);
15
15
  const durationValue = getElementStyle(element, animationDelay);
16
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
16
+ const durationScale = durationValue.includes('ms') ? /* istanbul ignore next */1 : 1000;
17
17
  const duration = supportAnimation && propertyValue && propertyValue !== 'none'
18
18
  ? parseFloat(durationValue) * durationScale : 0;
19
19
 
20
- return !Number.isNaN(duration) ? duration : 0;
20
+ return !Number.isNaN(duration) ? duration : /* istanbul ignore next */0;
21
21
  }
@@ -6,15 +6,15 @@ import getElementStyle from './getElementStyle';
6
6
  * Utility to get the computed `animationDuration`
7
7
  * from `HTMLElement` in miliseconds.
8
8
  *
9
- * @param {HTMLElement | Element} element target
9
+ * @param {HTMLElement} element target
10
10
  * @return {number} the value in miliseconds
11
11
  */
12
12
  export default function getElementAnimationDuration(element) {
13
13
  const propertyValue = getElementStyle(element, animationName);
14
14
  const durationValue = getElementStyle(element, animationDuration);
15
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
15
+ const durationScale = durationValue.includes('ms') ? /* istanbul ignore next */1 : 1000;
16
16
  const duration = propertyValue && propertyValue !== 'none'
17
17
  ? parseFloat(durationValue) * durationScale : 0;
18
18
 
19
- return !Number.isNaN(duration) ? duration : 0;
19
+ return !Number.isNaN(duration) ? duration : /* istanbul ignore next */0;
20
20
  }
@@ -7,15 +7,15 @@ import getElementStyle from './getElementStyle';
7
7
  * Utility to get the computed `animationDuration`
8
8
  * from `HTMLElement` in miliseconds.
9
9
  *
10
- * @param {HTMLElement | Element} element target
10
+ * @param {HTMLElement} element target
11
11
  * @return {number} the value in miliseconds
12
12
  */
13
13
  export default function getElementAnimationDuration(element) {
14
14
  const propertyValue = getElementStyle(element, animationName);
15
15
  const durationValue = getElementStyle(element, animationDuration);
16
- const durationScale = durationValue.includes('ms') ? 1 : 1000;
16
+ const durationScale = durationValue.includes('ms') ? /* istanbul ignore next */1 : 1000;
17
17
  const duration = supportAnimation && propertyValue && propertyValue !== 'none'
18
18
  ? parseFloat(durationValue) * durationScale : 0;
19
19
 
20
- return !Number.isNaN(duration) ? duration : 0;
20
+ return !Number.isNaN(duration) ? duration : /* istanbul ignore next */0;
21
21
  }
@@ -5,14 +5,16 @@
5
5
  * * If `element` parameter is not an `HTMLElement`, `getComputedStyle`
6
6
  * throws a `ReferenceError`.
7
7
  *
8
- * @param {HTMLElement | Element} element target
8
+ * @param {HTMLElement} element target
9
9
  * @param {string} property the css property
10
10
  * @return {string} the css property value
11
11
  */
12
12
  export default function getElementStyle(element, property) {
13
13
  const computedStyle = getComputedStyle(element);
14
14
 
15
- // @ts-ignore -- must use camelcase strings,
15
+ // must use camelcase strings,
16
16
  // or non-camelcase strings with `getPropertyValue`
17
- return property in computedStyle ? computedStyle[property] : '';
17
+ return property.includes('--')
18
+ ? computedStyle.getPropertyValue(property)
19
+ : computedStyle[property];
18
20
  }
@@ -6,16 +6,15 @@ import getElementStyle from './getElementStyle';
6
6
  * Utility to get the computed `transitionDelay`
7
7
  * from Element in miliseconds.
8
8
  *
9
- * @param {HTMLElement | Element} element target
9
+ * @param {HTMLElement} element target
10
10
  * @return {number} the value in miliseconds
11
11
  */
12
12
  export default function getElementTransitionDelay(element) {
13
13
  const propertyValue = getElementStyle(element, transitionProperty);
14
14
  const delayValue = getElementStyle(element, transitionDelay);
15
-
16
- const delayScale = delayValue.includes('ms') ? 1 : 1000;
15
+ const delayScale = delayValue.includes('ms') ? /* istanbul ignore next */1 : 1000;
17
16
  const duration = propertyValue && propertyValue !== 'none'
18
17
  ? parseFloat(delayValue) * delayScale : 0;
19
18
 
20
- return !Number.isNaN(duration) ? duration : 0;
19
+ return !Number.isNaN(duration) ? duration : /* istanbul ignore next */0;
21
20
  }
@@ -7,15 +7,15 @@ import getElementStyle from './getElementStyle';
7
7
  * Utility to get the computed `transitionDelay`
8
8
  * from Element in miliseconds.
9
9
  *
10
- * @param {HTMLElement | Element} element target
10
+ * @param {HTMLElement} element target
11
11
  * @return {number} the value in miliseconds
12
12
  */
13
13
  export default function getElementTransitionDelay(element) {
14
14
  const propertyValue = getElementStyle(element, transitionProperty);
15
15
  const delayValue = getElementStyle(element, transitionDelay);
16
- const delayScale = delayValue.includes('ms') ? 1 : 1000;
16
+ const delayScale = delayValue.includes('ms') ? /* istanbul ignore next */1 : 1000;
17
17
  const duration = supportTransition && propertyValue && propertyValue !== 'none'
18
18
  ? parseFloat(delayValue) * delayScale : 0;
19
19
 
20
- return !Number.isNaN(duration) ? duration : 0;
20
+ return !Number.isNaN(duration) ? duration : /* istanbul ignore next */0;
21
21
  }