Socket
Socket
Sign inDemoInstall

shorter-js

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shorter-js - npm Package Compare versions

Comparing version 0.2.0-alpha1 to 0.2.0-alpha2

src/misc/reflow.js

7

dist/shorter-js.esm.js
/*!
* shorter-js v0.2.0-alpha1 (https://thednp.github.io/shorter-js/)
* shorter-js v0.2.0-alpha2 (https://thednp.github.io/shorter-js/)
* Copyright 2019-2021 © dnp_theme

@@ -305,2 +305,6 @@ * Licensed under MIT (https://github.com/thednp/shorter-js/blob/master/LICENSE)

function reflow(element) {
return element.offsetHeight;
}
// strings FIRST

@@ -351,4 +355,5 @@

tryWrapper: tryWrapper,
reflow: reflow,
};
export default index;

4

dist/shorter-js.esm.min.js

@@ -1,2 +0,2 @@

// shorter-js v0.2.0-alpha1 | dnp_theme © 2021 | MIT-License
var e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n="webkitAnimation"in document.head.style?"webkitAnimationDuration":"animationDuration",t="webkitAnimation"in document.head.style?"webkitAnimationDelay":"animationDelay",i="webkitAnimation"in document.head.style?"webkitAnimationEnd":"animationend",a="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",o="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",r="webkitTransition"in document.head.style?"webkitTransitionProperty":"transitionProperty",u="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",s="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",c=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),m="webkitPerspective"in document.head.style||"perspective"in document.head.style,d=function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){return e=!0}});document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e,n)}),n)}catch(e){throw Error("Passive events are not supported")}return e}(),l="webkitTransform"in document.head.style||"transform"in document.head.style,b="ontouchstart"in window||navigator.msMaxTouchPoints||!1,v="webkitAnimation"in document.head.style||"animation"in document.head.style,p="webkitTransition"in document.head.style||"transition"in document.head.style;function g(e,n,t,i){var a=i||!1;e.addEventListener(n,t,a)}function E(e,n,t,i){var a=i||!1;e.removeEventListener(n,t,a)}function f(e){var t=getComputedStyle(e),i=t[a],o=t[n],r=o.includes("ms")?1:1e3,u=v&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(u)?0:u}function y(e){var n=getComputedStyle(e),t=n[r],i=n[o],a=i.includes("ms")?1:1e3,u=p&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(u)?0:u}function h(e){return"true"===e||"false"!==e&&(Number.isNaN(e)?""===e||"null"===e?null:e:+e)}var w={mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseHoverEvents:e,touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},focusEvents:{in:"focusin",out:"focusout"},mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseout"},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:n,animationDelay:t,animationName:a,animationEndEvent:i,transitionDuration:o,transitionDelay:u,transitionEndEvent:s,transitionProperty:r,isMobile:c,support3DTransform:m,supportPassive:d,supportTransform:l,supportTouch:b,supportAnimation:v,supportTransition:p,addEventListener:"addEventListener",removeEventListener:"removeEventListener",addClass:function(e,n){e.classList.add(n)},removeClass:function(e,n){e.classList.remove(n)},hasClass:function(e,n){return e.classList.contains(n)},on:g,off:E,one:function(e,n,t,i){g(e,n,(function a(o){o.target===e&&(t.apply(e,[o]),E(e,n,a,i))}),i)},emulateAnimationEnd:function(e,n){var t=0,a=new Event(i),o=f(e);o?(e.addEventListener(i,(function a(o){o.target===e&&(n.apply(e,[o]),e.removeEventListener(i,a),t=1)})),setTimeout((function(){t||e.dispatchEvent(a)}),o+17)):n.apply(e,[a])},emulateTransitionEnd:function(e,n){var t=0,i=new Event(s),a=y(e);a?(e.addEventListener(s,(function i(a){a.target===e&&(n.apply(e,[a]),e.removeEventListener(s,i),t=1)})),setTimeout((function(){t||e.dispatchEvent(i)}),a+17)):n.apply(e,[i])},isElementInScrollRange:function(e){var n=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;return n.top<=t&&n.bottom>=0},isElementInViewport:function(e){var n=e.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)},passiveHandler:!!d&&{passive:!0},getElementAnimationDuration:f,getElementAnimationDelay:function(e){var n=getComputedStyle(e),i=n[a],o=n[t],r=o.includes("ms")?1:1e3,u=v&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(u)?0:u},getElementTransitionDuration:y,getElementTransitionDelay:function(e){var n=getComputedStyle(e),t=n[r],i=n[u],a=i.includes("ms")?1:1e3,o=p&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(o)?0:o},queryElement:function(e,n){var t=n&&n instanceof Element?n:document;return e instanceof Element?e:t.querySelector(e)},normalizeValue:h,normalizeOptions:function(e,n,t,i){var a={},o={},r=Object.assign({},e.dataset);return Object.keys(r).forEach((function(e){var n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return e.toLowerCase()})):e;o[n]=h(r[e])})),Object.keys(t).forEach((function(e){t[e]=h(t[e])})),Object.keys(n).forEach((function(e){a[e]=e in t?t[e]:e in o?o[e]:n[e]})),a},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(n+" "+e)}}};export default w;
// shorter-js v0.2.0-alpha2 | dnp_theme © 2021 | MIT-License
var e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n="webkitAnimation"in document.head.style?"webkitAnimationDuration":"animationDuration",t="webkitAnimation"in document.head.style?"webkitAnimationDelay":"animationDelay",i="webkitAnimation"in document.head.style?"webkitAnimationEnd":"animationend",a="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",o="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",r="webkitTransition"in document.head.style?"webkitTransitionProperty":"transitionProperty",u="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",s="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",c=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),m="webkitPerspective"in document.head.style||"perspective"in document.head.style,d=function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){return e=!0}});document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e,n)}),n)}catch(e){throw Error("Passive events are not supported")}return e}(),l="webkitTransform"in document.head.style||"transform"in document.head.style,b="ontouchstart"in window||navigator.msMaxTouchPoints||!1,v="webkitAnimation"in document.head.style||"animation"in document.head.style,p="webkitTransition"in document.head.style||"transition"in document.head.style;function f(e,n,t,i){var a=i||!1;e.addEventListener(n,t,a)}function g(e,n,t,i){var a=i||!1;e.removeEventListener(n,t,a)}function E(e){var t=getComputedStyle(e),i=t[a],o=t[n],r=o.includes("ms")?1:1e3,u=v&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(u)?0:u}function y(e){var n=getComputedStyle(e),t=n[r],i=n[o],a=i.includes("ms")?1:1e3,u=p&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(u)?0:u}function h(e){return"true"===e||"false"!==e&&(Number.isNaN(e)?""===e||"null"===e?null:e:+e)}var w={mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseHoverEvents:e,touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},focusEvents:{in:"focusin",out:"focusout"},mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseout"},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:n,animationDelay:t,animationName:a,animationEndEvent:i,transitionDuration:o,transitionDelay:u,transitionEndEvent:s,transitionProperty:r,isMobile:c,support3DTransform:m,supportPassive:d,supportTransform:l,supportTouch:b,supportAnimation:v,supportTransition:p,addEventListener:"addEventListener",removeEventListener:"removeEventListener",addClass:function(e,n){e.classList.add(n)},removeClass:function(e,n){e.classList.remove(n)},hasClass:function(e,n){return e.classList.contains(n)},on:f,off:g,one:function(e,n,t,i){f(e,n,(function a(o){o.target===e&&(t.apply(e,[o]),g(e,n,a,i))}),i)},emulateAnimationEnd:function(e,n){var t=0,a=new Event(i),o=E(e);o?(e.addEventListener(i,(function a(o){o.target===e&&(n.apply(e,[o]),e.removeEventListener(i,a),t=1)})),setTimeout((function(){t||e.dispatchEvent(a)}),o+17)):n.apply(e,[a])},emulateTransitionEnd:function(e,n){var t=0,i=new Event(s),a=y(e);a?(e.addEventListener(s,(function i(a){a.target===e&&(n.apply(e,[a]),e.removeEventListener(s,i),t=1)})),setTimeout((function(){t||e.dispatchEvent(i)}),a+17)):n.apply(e,[i])},isElementInScrollRange:function(e){var n=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;return n.top<=t&&n.bottom>=0},isElementInViewport:function(e){var n=e.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)},passiveHandler:!!d&&{passive:!0},getElementAnimationDuration:E,getElementAnimationDelay:function(e){var n=getComputedStyle(e),i=n[a],o=n[t],r=o.includes("ms")?1:1e3,u=v&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(u)?0:u},getElementTransitionDuration:y,getElementTransitionDelay:function(e){var n=getComputedStyle(e),t=n[r],i=n[u],a=i.includes("ms")?1:1e3,o=p&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(o)?0:o},queryElement:function(e,n){var t=n&&n instanceof Element?n:document;return e instanceof Element?e:t.querySelector(e)},normalizeValue:h,normalizeOptions:function(e,n,t,i){var a={},o={},r=Object.assign({},e.dataset);return Object.keys(r).forEach((function(e){var n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return e.toLowerCase()})):e;o[n]=h(r[e])})),Object.keys(t).forEach((function(e){t[e]=h(t[e])})),Object.keys(n).forEach((function(e){a[e]=e in t?t[e]:e in o?o[e]:n[e]})),a},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(n+" "+e)}},reflow:function(e){return e.offsetHeight}};export default w;
/*!
* shorter-js v0.2.0-alpha1 (https://thednp.github.io/shorter-js/)
* shorter-js v0.2.0-alpha2 (https://thednp.github.io/shorter-js/)
* Copyright 2019-2021 © dnp_theme

@@ -311,2 +311,6 @@ * Licensed under MIT (https://github.com/thednp/shorter-js/blob/master/LICENSE)

function reflow(element) {
return element.offsetHeight;
}
// strings FIRST

@@ -357,2 +361,3 @@

tryWrapper: tryWrapper,
reflow: reflow,
};

@@ -359,0 +364,0 @@

@@ -1,2 +0,2 @@

// shorter-js v0.2.0-alpha1 | dnp_theme © 2021 | MIT-License
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).SHORTER=n()}(this,(function(){"use strict";var e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n="webkitAnimation"in document.head.style?"webkitAnimationDuration":"animationDuration",t="webkitAnimation"in document.head.style?"webkitAnimationDelay":"animationDelay",i="webkitAnimation"in document.head.style?"webkitAnimationEnd":"animationend",o="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",a="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",r="webkitTransition"in document.head.style?"webkitTransitionProperty":"transitionProperty",u="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",s="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",c=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),m="webkitPerspective"in document.head.style||"perspective"in document.head.style,d=function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){return e=!0}});document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e,n)}),n)}catch(e){throw Error("Passive events are not supported")}return e}(),l="webkitTransform"in document.head.style||"transform"in document.head.style,b="ontouchstart"in window||navigator.msMaxTouchPoints||!1,p="webkitAnimation"in document.head.style||"animation"in document.head.style,v="webkitTransition"in document.head.style||"transition"in document.head.style;function f(e,n,t,i){var o=i||!1;e.addEventListener(n,t,o)}function g(e,n,t,i){var o=i||!1;e.removeEventListener(n,t,o)}function E(e){var t=getComputedStyle(e),i=t[o],a=t[n],r=a.includes("ms")?1:1e3,u=p&&i&&"none"!==i?parseFloat(a)*r:0;return Number.isNaN(u)?0:u}function y(e){var n=getComputedStyle(e),t=n[r],i=n[a],o=i.includes("ms")?1:1e3,u=v&&t&&"none"!==t?parseFloat(i)*o:0;return Number.isNaN(u)?0:u}function h(e){return"true"===e||"false"!==e&&(Number.isNaN(e)?""===e||"null"===e?null:e:+e)}return{mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseHoverEvents:e,touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},focusEvents:{in:"focusin",out:"focusout"},mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseout"},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:n,animationDelay:t,animationName:o,animationEndEvent:i,transitionDuration:a,transitionDelay:u,transitionEndEvent:s,transitionProperty:r,isMobile:c,support3DTransform:m,supportPassive:d,supportTransform:l,supportTouch:b,supportAnimation:p,supportTransition:v,addEventListener:"addEventListener",removeEventListener:"removeEventListener",addClass:function(e,n){e.classList.add(n)},removeClass:function(e,n){e.classList.remove(n)},hasClass:function(e,n){return e.classList.contains(n)},on:f,off:g,one:function(e,n,t,i){f(e,n,(function o(a){a.target===e&&(t.apply(e,[a]),g(e,n,o,i))}),i)},emulateAnimationEnd:function(e,n){var t=0,o=new Event(i),a=E(e);a?(e.addEventListener(i,(function o(a){a.target===e&&(n.apply(e,[a]),e.removeEventListener(i,o),t=1)})),setTimeout((function(){t||e.dispatchEvent(o)}),a+17)):n.apply(e,[o])},emulateTransitionEnd:function(e,n){var t=0,i=new Event(s),o=y(e);o?(e.addEventListener(s,(function i(o){o.target===e&&(n.apply(e,[o]),e.removeEventListener(s,i),t=1)})),setTimeout((function(){t||e.dispatchEvent(i)}),o+17)):n.apply(e,[i])},isElementInScrollRange:function(e){var n=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;return n.top<=t&&n.bottom>=0},isElementInViewport:function(e){var n=e.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)},passiveHandler:!!d&&{passive:!0},getElementAnimationDuration:E,getElementAnimationDelay:function(e){var n=getComputedStyle(e),i=n[o],a=n[t],r=a.includes("ms")?1:1e3,u=p&&i&&"none"!==i?parseFloat(a)*r:0;return Number.isNaN(u)?0:u},getElementTransitionDuration:y,getElementTransitionDelay:function(e){var n=getComputedStyle(e),t=n[r],i=n[u],o=i.includes("ms")?1:1e3,a=v&&t&&"none"!==t?parseFloat(i)*o:0;return Number.isNaN(a)?0:a},queryElement:function(e,n){var t=n&&n instanceof Element?n:document;return e instanceof Element?e:t.querySelector(e)},normalizeValue:h,normalizeOptions:function(e,n,t,i){var o={},a={},r=Object.assign({},e.dataset);return Object.keys(r).forEach((function(e){var n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return e.toLowerCase()})):e;a[n]=h(r[e])})),Object.keys(t).forEach((function(e){t[e]=h(t[e])})),Object.keys(n).forEach((function(e){o[e]=e in t?t[e]:e in a?a[e]:n[e]})),o},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(n+" "+e)}}}}));
// shorter-js v0.2.0-alpha2 | dnp_theme © 2021 | MIT-License
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e=e||self).SHORTER=n()}(this,(function(){"use strict";var e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n="webkitAnimation"in document.head.style?"webkitAnimationDuration":"animationDuration",t="webkitAnimation"in document.head.style?"webkitAnimationDelay":"animationDelay",i="webkitAnimation"in document.head.style?"webkitAnimationEnd":"animationend",o="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",a="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",r="webkitTransition"in document.head.style?"webkitTransitionProperty":"transitionProperty",u="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",s="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",c=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),m="webkitPerspective"in document.head.style||"perspective"in document.head.style,d=function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){return e=!0}});document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e,n)}),n)}catch(e){throw Error("Passive events are not supported")}return e}(),l="webkitTransform"in document.head.style||"transform"in document.head.style,b="ontouchstart"in window||navigator.msMaxTouchPoints||!1,p="webkitAnimation"in document.head.style||"animation"in document.head.style,v="webkitTransition"in document.head.style||"transition"in document.head.style;function f(e,n,t,i){var o=i||!1;e.addEventListener(n,t,o)}function g(e,n,t,i){var o=i||!1;e.removeEventListener(n,t,o)}function E(e){var t=getComputedStyle(e),i=t[o],a=t[n],r=a.includes("ms")?1:1e3,u=p&&i&&"none"!==i?parseFloat(a)*r:0;return Number.isNaN(u)?0:u}function y(e){var n=getComputedStyle(e),t=n[r],i=n[a],o=i.includes("ms")?1:1e3,u=v&&t&&"none"!==t?parseFloat(i)*o:0;return Number.isNaN(u)?0:u}function h(e){return"true"===e||"false"!==e&&(Number.isNaN(e)?""===e||"null"===e?null:e:+e)}return{mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseHoverEvents:e,touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},focusEvents:{in:"focusin",out:"focusout"},mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseout"},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:n,animationDelay:t,animationName:o,animationEndEvent:i,transitionDuration:a,transitionDelay:u,transitionEndEvent:s,transitionProperty:r,isMobile:c,support3DTransform:m,supportPassive:d,supportTransform:l,supportTouch:b,supportAnimation:p,supportTransition:v,addEventListener:"addEventListener",removeEventListener:"removeEventListener",addClass:function(e,n){e.classList.add(n)},removeClass:function(e,n){e.classList.remove(n)},hasClass:function(e,n){return e.classList.contains(n)},on:f,off:g,one:function(e,n,t,i){f(e,n,(function o(a){a.target===e&&(t.apply(e,[a]),g(e,n,o,i))}),i)},emulateAnimationEnd:function(e,n){var t=0,o=new Event(i),a=E(e);a?(e.addEventListener(i,(function o(a){a.target===e&&(n.apply(e,[a]),e.removeEventListener(i,o),t=1)})),setTimeout((function(){t||e.dispatchEvent(o)}),a+17)):n.apply(e,[o])},emulateTransitionEnd:function(e,n){var t=0,i=new Event(s),o=y(e);o?(e.addEventListener(s,(function i(o){o.target===e&&(n.apply(e,[o]),e.removeEventListener(s,i),t=1)})),setTimeout((function(){t||e.dispatchEvent(i)}),o+17)):n.apply(e,[i])},isElementInScrollRange:function(e){var n=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;return n.top<=t&&n.bottom>=0},isElementInViewport:function(e){var n=e.getBoundingClientRect();return n.top>=0&&n.left>=0&&n.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&n.right<=(window.innerWidth||document.documentElement.clientWidth)},passiveHandler:!!d&&{passive:!0},getElementAnimationDuration:E,getElementAnimationDelay:function(e){var n=getComputedStyle(e),i=n[o],a=n[t],r=a.includes("ms")?1:1e3,u=p&&i&&"none"!==i?parseFloat(a)*r:0;return Number.isNaN(u)?0:u},getElementTransitionDuration:y,getElementTransitionDelay:function(e){var n=getComputedStyle(e),t=n[r],i=n[u],o=i.includes("ms")?1:1e3,a=v&&t&&"none"!==t?parseFloat(i)*o:0;return Number.isNaN(a)?0:a},queryElement:function(e,n){var t=n&&n instanceof Element?n:document;return e instanceof Element?e:t.querySelector(e)},normalizeValue:h,normalizeOptions:function(e,n,t,i){var o={},a={},r=Object.assign({},e.dataset);return Object.keys(r).forEach((function(e){var n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return e.toLowerCase()})):e;a[n]=h(r[e])})),Object.keys(t).forEach((function(e){t[e]=h(t[e])})),Object.keys(n).forEach((function(e){o[e]=e in t?t[e]:e in a?a[e]:n[e]})),o},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(n+" "+e)}},reflow:function(e){return e.offsetHeight}}}));
{
"name": "shorter-js",
"version": "0.2.0-alpha1",
"version": "0.2.0-alpha2",
"description": "A small ES6+ library with various JavaScript tools useful for creating light libraries.",

@@ -5,0 +5,0 @@ "main": "dist/shorter-js.min.js",

@@ -52,2 +52,3 @@ // strings FIRST

import tryWrapper from './misc/tryWrapper.js';
import reflow from './misc/reflow.js';

@@ -97,2 +98,3 @@ export default {

tryWrapper,
reflow,
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc