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.14 to 0.2.15

13

dist/shorter-js.esm.js
/*!
* shorter-js v0.2.14 (https://github.com/thednp/shorter-js)
* shorter-js v0.2.15 (https://github.com/thednp/shorter-js)
* Copyright 2019-2021 © dnp_theme

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

// @ts-ignore
const { userAgentData } = navigator;
const appleBrands = /(iPhone|iPod|iPad)/;

@@ -209,5 +211,4 @@

* A global namespace for Apple browsers.
* @type {boolean}
*/
// @ts-ignore
const { userAgentData } = navigator;
const isApple = !userAgentData ? appleBrands.test(navigator.userAgent)

@@ -383,3 +384,3 @@ : userAgentData.brands.some((x) => appleBrands.test(x.brand));

* @param {string} component the component's name or a unique key
* @param {Record<string, any>} instance the component instance
* @param {any} instance the component instance
*/

@@ -445,3 +446,3 @@ set: (element, component, instance) => {

* An alias for `Data.get()`.
* @param {Element} element target element
* @param {Element | string} element target element
* @param {string} component the component's name or a unique key

@@ -757,3 +758,3 @@ * @returns {any} the request result

var version = "0.2.14";
var version = "0.2.15";

@@ -760,0 +761,0 @@ // @ts-ignore

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

// shorter-js v0.2.14 | dnp_theme © 2021 | MIT-License
const 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",s="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",u="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",c=/iPhone|iPad|iPod|Android/i;let d=!1;d=navigator.userAgentData?navigator.userAgentData.brands.some(e=>c.test(e.brand)):c.test(navigator.userAgent);const l=d,m=/(iPhone|iPod|iPad)/,{userAgentData:b}=navigator,g=b?b.brands.some(e=>m.test(e.brand)):m.test(navigator.userAgent),p="webkitPerspective"in document.head.style||"perspective"in document.head.style,E=(()=>{let e=!1;try{const n=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e,n)}),n)}catch(e){throw Error("Passive events are not supported")}return e})(),v="webkitTransform"in document.head.style||"transform"in document.head.style,h="ontouchstart"in window||"msMaxTouchPoints"in navigator,f="webkitAnimation"in document.head.style||"animation"in document.head.style,y="webkitTransition"in document.head.style||"transition"in document.head.style;function w(e,n,t,i){const a=i||!1;e.addEventListener(n,t,a)}function k(e,n,t,i){const a=i||!1;e.removeEventListener(n,t,a)}function z(e){return e instanceof Element}function T(e,n){const t=n&&z(n)?n:document;return z(e)?e:t.querySelector(e)}const L=new Map,D={set:(e,n,t)=>{const i=T(e);if(!z(i))return;L.has(n)||L.set(n,new Map);L.get(n).set(i,t)},getAllFor:e=>L.has(e)?L.get(e):null,get:(e,n)=>{const t=T(e),i=D.getAllFor(n);return i&&z(t)&&i.has(t)?i.get(t):null},remove:(e,n)=>{if(!L.has(n))return;const t=L.get(n);t.delete(e),0===t.size&&L.delete(n)}};function A(e){const n=getComputedStyle(e),i=n[a],o=n[t],r=o.includes("ms")?1:1e3,s=f&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(s)?0:s}function O(e){const t=getComputedStyle(e),i=t[a],o=t[n],r=o.includes("ms")?1:1e3,s=f&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(s)?0:s}function C(e){const n=getComputedStyle(e),t=n[r],i=n[s],a=i.includes("ms")?1:1e3,o=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(o)?0:o}function I(e){const n=getComputedStyle(e),t=n[r],i=n[o],a=i.includes("ms")?1:1e3,s=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(s)?0:s}function N(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}const P={ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",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:s,transitionEndEvent:u,transitionProperty:r,isMobile:l,isApple:g,support3DTransform:p,supportPassive:E,supportTransform:v,supportTouch:h,supportAnimation:f,supportTransition:y,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:w,off:k,one:function(e,n,t,i){w(e,n,(function a(o){o.target===e&&(t.apply(e,[o]),k(e,n,a,i))}),i)},Data:D,getInstance:(e,n)=>D.get(e,n),emulateAnimationEnd:function(e,n){let t=0;const a=new Event(i),o=O(e),r=A(e);if(o){const s=a=>{a.target===e&&(n.apply(e,[a]),e.removeEventListener(i,s),t=1)};e.addEventListener(i,s),setTimeout(()=>{t||e.dispatchEvent(a)},o+r+17)}else n.apply(e,[a])},emulateTransitionEnd:function(e,n){let t=0;const i=new Event(u),a=I(e),o=C(e);if(a){const r=i=>{i.target===e&&(n.apply(e,[i]),e.removeEventListener(u,r),t=1)};e.addEventListener(u,r),setTimeout(()=>{t||e.dispatchEvent(i)},a+o+17)}else n.apply(e,[i])},isElementInScrollRange:function(e){const n=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;return n.top<=t&&n.bottom>=0},isElementInViewport:function(e){const 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:!!E&&{passive:!0},getElementAnimationDuration:O,getElementAnimationDelay:A,getElementTransitionDuration:I,getElementTransitionDelay:C,isElement:z,isHTMLElement:function(e){return e instanceof HTMLElement},isMedia:function(e){return[SVGElement,HTMLImageElement,HTMLVideoElement].some(n=>e instanceof n)},isRTL:()=>"rtl"===document.documentElement.dir,queryElement:T,normalizeValue:N,normalizeOptions:function(e,n,t,i){const a={...e.dataset},o={},r={};return Object.keys(a).forEach(e=>{const n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,e=>e.toLowerCase()):e;r[n]=N(a[e])}),Object.keys(t).forEach(e=>{t[e]=N(t[e])}),Object.keys(n).forEach(e=>{o[e]=e in t?t[e]:e in r?r[e]:n[e]}),o},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(`${n} ${e}`)}},reflow:function(e){return e.offsetHeight},Version:"0.2.14"};export default P;
// shorter-js v0.2.15 | dnp_theme © 2021 | MIT-License
const 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",s="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",u="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",c=/iPhone|iPad|iPod|Android/i;let d=!1;d=navigator.userAgentData?navigator.userAgentData.brands.some(e=>c.test(e.brand)):c.test(navigator.userAgent);const l=d,{userAgentData:m}=navigator,b=/(iPhone|iPod|iPad)/,g=m?m.brands.some(e=>b.test(e.brand)):b.test(navigator.userAgent),p="webkitPerspective"in document.head.style||"perspective"in document.head.style,E=(()=>{let e=!1;try{const n=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});document.addEventListener("DOMContentLoaded",(function e(){document.removeEventListener("DOMContentLoaded",e,n)}),n)}catch(e){throw Error("Passive events are not supported")}return e})(),v="webkitTransform"in document.head.style||"transform"in document.head.style,h="ontouchstart"in window||"msMaxTouchPoints"in navigator,f="webkitAnimation"in document.head.style||"animation"in document.head.style,y="webkitTransition"in document.head.style||"transition"in document.head.style;function w(e,n,t,i){const a=i||!1;e.addEventListener(n,t,a)}function k(e,n,t,i){const a=i||!1;e.removeEventListener(n,t,a)}function z(e){return e instanceof Element}function T(e,n){const t=n&&z(n)?n:document;return z(e)?e:t.querySelector(e)}const L=new Map,D={set:(e,n,t)=>{const i=T(e);if(!z(i))return;L.has(n)||L.set(n,new Map);L.get(n).set(i,t)},getAllFor:e=>L.has(e)?L.get(e):null,get:(e,n)=>{const t=T(e),i=D.getAllFor(n);return i&&z(t)&&i.has(t)?i.get(t):null},remove:(e,n)=>{if(!L.has(n))return;const t=L.get(n);t.delete(e),0===t.size&&L.delete(n)}};function A(e){const n=getComputedStyle(e),i=n[a],o=n[t],r=o.includes("ms")?1:1e3,s=f&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(s)?0:s}function O(e){const t=getComputedStyle(e),i=t[a],o=t[n],r=o.includes("ms")?1:1e3,s=f&&i&&"none"!==i?parseFloat(o)*r:0;return Number.isNaN(s)?0:s}function C(e){const n=getComputedStyle(e),t=n[r],i=n[s],a=i.includes("ms")?1:1e3,o=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(o)?0:o}function I(e){const n=getComputedStyle(e),t=n[r],i=n[o],a=i.includes("ms")?1:1e3,s=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(s)?0:s}function N(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}const P={ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",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:s,transitionEndEvent:u,transitionProperty:r,isMobile:l,isApple:g,support3DTransform:p,supportPassive:E,supportTransform:v,supportTouch:h,supportAnimation:f,supportTransition:y,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:w,off:k,one:function(e,n,t,i){w(e,n,(function a(o){o.target===e&&(t.apply(e,[o]),k(e,n,a,i))}),i)},Data:D,getInstance:(e,n)=>D.get(e,n),emulateAnimationEnd:function(e,n){let t=0;const a=new Event(i),o=O(e),r=A(e);if(o){const s=a=>{a.target===e&&(n.apply(e,[a]),e.removeEventListener(i,s),t=1)};e.addEventListener(i,s),setTimeout(()=>{t||e.dispatchEvent(a)},o+r+17)}else n.apply(e,[a])},emulateTransitionEnd:function(e,n){let t=0;const i=new Event(u),a=I(e),o=C(e);if(a){const r=i=>{i.target===e&&(n.apply(e,[i]),e.removeEventListener(u,r),t=1)};e.addEventListener(u,r),setTimeout(()=>{t||e.dispatchEvent(i)},a+o+17)}else n.apply(e,[i])},isElementInScrollRange:function(e){const n=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight;return n.top<=t&&n.bottom>=0},isElementInViewport:function(e){const 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:!!E&&{passive:!0},getElementAnimationDuration:O,getElementAnimationDelay:A,getElementTransitionDuration:I,getElementTransitionDelay:C,isElement:z,isHTMLElement:function(e){return e instanceof HTMLElement},isMedia:function(e){return[SVGElement,HTMLImageElement,HTMLVideoElement].some(n=>e instanceof n)},isRTL:()=>"rtl"===document.documentElement.dir,queryElement:T,normalizeValue:N,normalizeOptions:function(e,n,t,i){const a={...e.dataset},o={},r={};return Object.keys(a).forEach(e=>{const n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,e=>e.toLowerCase()):e;r[n]=N(a[e])}),Object.keys(t).forEach(e=>{t[e]=N(t[e])}),Object.keys(n).forEach(e=>{o[e]=e in t?t[e]:e in r?r[e]:n[e]}),o},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(`${n} ${e}`)}},reflow:function(e){return e.offsetHeight},Version:"0.2.15"};export default P;
/*!
* shorter-js v0.2.14 (https://github.com/thednp/shorter-js)
* shorter-js v0.2.15 (https://github.com/thednp/shorter-js)
* Copyright 2019-2021 © dnp_theme

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

// @ts-ignore
var userAgentData = navigator.userAgentData;
var appleBrands = /(iPhone|iPod|iPad)/;

@@ -215,5 +217,4 @@

* A global namespace for Apple browsers.
* @type {boolean}
*/
// @ts-ignore
var userAgentData = navigator.userAgentData;
var isApple = !userAgentData ? appleBrands.test(navigator.userAgent)

@@ -389,3 +390,3 @@ : userAgentData.brands.some(function (x) { return appleBrands.test(x.brand); });

* @param {string} component the component's name or a unique key
* @param {Record<string, any>} instance the component instance
* @param {any} instance the component instance
*/

@@ -451,3 +452,3 @@ set: function (element, component, instance) {

* An alias for `Data.get()`.
* @param {Element} element target element
* @param {Element | string} element target element
* @param {string} component the component's name or a unique key

@@ -763,3 +764,3 @@ * @returns {any} the request result

var version = "0.2.14";
var version = "0.2.15";

@@ -766,0 +767,0 @@ // @ts-ignore

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

// shorter-js v0.2.14 | 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",a="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",r="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",o="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,d=navigator.userAgentData?navigator.userAgentData.brands.some((function(e){return c.test(e.brand)})):c.test(navigator.userAgent),l=/(iPhone|iPod|iPad)/,m=navigator.userAgentData,b=m?m.brands.some((function(e){return l.test(e.brand)})):l.test(navigator.userAgent),f="webkitPerspective"in document.head.style||"perspective"in document.head.style,v=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}(),p="webkitTransform"in document.head.style||"transform"in document.head.style,g="ontouchstart"in window||"msMaxTouchPoints"in navigator,E="webkitAnimation"in document.head.style||"animation"in document.head.style,y="webkitTransition"in document.head.style||"transition"in document.head.style;function h(e,n,t,i){var a=i||!1;e.addEventListener(n,t,a)}function w(e,n,t,i){var a=i||!1;e.removeEventListener(n,t,a)}function k(e){return e instanceof Element}function z(e,n){var t=n&&k(n)?n:document;return k(e)?e:t.querySelector(e)}var T=new Map,L={set:function(e,n,t){var i=z(e);k(i)&&(T.has(n)||T.set(n,new Map),T.get(n).set(i,t))},getAllFor:function(e){return T.has(e)?T.get(e):null},get:function(e,n){var t=z(e),i=L.getAllFor(n);return i&&k(t)&&i.has(t)?i.get(t):null},remove:function(e,n){if(T.has(n)){var t=T.get(n);t.delete(e),0===t.size&&T.delete(n)}}};function O(e){var n=getComputedStyle(e),i=n[a],r=n[t],o=r.includes("ms")?1:1e3,u=E&&i&&"none"!==i?parseFloat(r)*o:0;return Number.isNaN(u)?0:u}function D(e){var t=getComputedStyle(e),i=t[a],r=t[n],o=r.includes("ms")?1:1e3,u=E&&i&&"none"!==i?parseFloat(r)*o:0;return Number.isNaN(u)?0:u}function A(e){var n=getComputedStyle(e),t=n[o],i=n[u],a=i.includes("ms")?1:1e3,r=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(r)?0:r}function C(e){var n=getComputedStyle(e),t=n[o],i=n[r],a=i.includes("ms")?1:1e3,u=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(u)?0:u}function I(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}return{ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",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:r,transitionDelay:u,transitionEndEvent:s,transitionProperty:o,isMobile:d,isApple:b,support3DTransform:f,supportPassive:v,supportTransform:p,supportTouch:g,supportAnimation:E,supportTransition:y,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:h,off:w,one:function(e,n,t,i){h(e,n,(function a(r){r.target===e&&(t.apply(e,[r]),w(e,n,a,i))}),i)},Data:L,getInstance:function(e,n){return L.get(e,n)},emulateAnimationEnd:function(e,n){var t=0,a=new Event(i),r=D(e),o=O(e);if(r){var u=function(a){a.target===e&&(n.apply(e,[a]),e.removeEventListener(i,u),t=1)};e.addEventListener(i,u),setTimeout((function(){t||e.dispatchEvent(a)}),r+o+17)}else n.apply(e,[a])},emulateTransitionEnd:function(e,n){var t=0,i=new Event(s),a=C(e),r=A(e);if(a){var o=function(i){i.target===e&&(n.apply(e,[i]),e.removeEventListener(s,o),t=1)};e.addEventListener(s,o),setTimeout((function(){t||e.dispatchEvent(i)}),a+r+17)}else 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:!!v&&{passive:!0},getElementAnimationDuration:D,getElementAnimationDelay:O,getElementTransitionDuration:C,getElementTransitionDelay:A,isElement:k,isHTMLElement:function(e){return e instanceof HTMLElement},isMedia:function(e){return[SVGElement,HTMLImageElement,HTMLVideoElement].some((function(n){return e instanceof n}))},isRTL:function(){return"rtl"===document.documentElement.dir},queryElement:z,normalizeValue:I,normalizeOptions:function(e,n,t,i){var a=Object.assign({},e.dataset),r={},o={};return Object.keys(a).forEach((function(e){var n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return e.toLowerCase()})):e;o[n]=I(a[e])})),Object.keys(t).forEach((function(e){t[e]=I(t[e])})),Object.keys(n).forEach((function(e){r[e]=e in t?t[e]:e in o?o[e]:n[e]})),r},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(n+" "+e)}},reflow:function(e){return e.offsetHeight},Version:"0.2.14"}}));
// shorter-js v0.2.15 | 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",a="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",r="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",o="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,d=navigator.userAgentData?navigator.userAgentData.brands.some((function(e){return c.test(e.brand)})):c.test(navigator.userAgent),l=navigator.userAgentData,m=/(iPhone|iPod|iPad)/,b=l?l.brands.some((function(e){return m.test(e.brand)})):m.test(navigator.userAgent),f="webkitPerspective"in document.head.style||"perspective"in document.head.style,v=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}(),p="webkitTransform"in document.head.style||"transform"in document.head.style,g="ontouchstart"in window||"msMaxTouchPoints"in navigator,E="webkitAnimation"in document.head.style||"animation"in document.head.style,y="webkitTransition"in document.head.style||"transition"in document.head.style;function h(e,n,t,i){var a=i||!1;e.addEventListener(n,t,a)}function w(e,n,t,i){var a=i||!1;e.removeEventListener(n,t,a)}function k(e){return e instanceof Element}function z(e,n){var t=n&&k(n)?n:document;return k(e)?e:t.querySelector(e)}var T=new Map,L={set:function(e,n,t){var i=z(e);k(i)&&(T.has(n)||T.set(n,new Map),T.get(n).set(i,t))},getAllFor:function(e){return T.has(e)?T.get(e):null},get:function(e,n){var t=z(e),i=L.getAllFor(n);return i&&k(t)&&i.has(t)?i.get(t):null},remove:function(e,n){if(T.has(n)){var t=T.get(n);t.delete(e),0===t.size&&T.delete(n)}}};function O(e){var n=getComputedStyle(e),i=n[a],r=n[t],o=r.includes("ms")?1:1e3,u=E&&i&&"none"!==i?parseFloat(r)*o:0;return Number.isNaN(u)?0:u}function D(e){var t=getComputedStyle(e),i=t[a],r=t[n],o=r.includes("ms")?1:1e3,u=E&&i&&"none"!==i?parseFloat(r)*o:0;return Number.isNaN(u)?0:u}function A(e){var n=getComputedStyle(e),t=n[o],i=n[u],a=i.includes("ms")?1:1e3,r=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(r)?0:r}function C(e){var n=getComputedStyle(e),t=n[o],i=n[r],a=i.includes("ms")?1:1e3,u=y&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(u)?0:u}function I(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}return{ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",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:r,transitionDelay:u,transitionEndEvent:s,transitionProperty:o,isMobile:d,isApple:b,support3DTransform:f,supportPassive:v,supportTransform:p,supportTouch:g,supportAnimation:E,supportTransition:y,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:h,off:w,one:function(e,n,t,i){h(e,n,(function a(r){r.target===e&&(t.apply(e,[r]),w(e,n,a,i))}),i)},Data:L,getInstance:function(e,n){return L.get(e,n)},emulateAnimationEnd:function(e,n){var t=0,a=new Event(i),r=D(e),o=O(e);if(r){var u=function(a){a.target===e&&(n.apply(e,[a]),e.removeEventListener(i,u),t=1)};e.addEventListener(i,u),setTimeout((function(){t||e.dispatchEvent(a)}),r+o+17)}else n.apply(e,[a])},emulateTransitionEnd:function(e,n){var t=0,i=new Event(s),a=C(e),r=A(e);if(a){var o=function(i){i.target===e&&(n.apply(e,[i]),e.removeEventListener(s,o),t=1)};e.addEventListener(s,o),setTimeout((function(){t||e.dispatchEvent(i)}),a+r+17)}else 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:!!v&&{passive:!0},getElementAnimationDuration:D,getElementAnimationDelay:O,getElementTransitionDuration:C,getElementTransitionDelay:A,isElement:k,isHTMLElement:function(e){return e instanceof HTMLElement},isMedia:function(e){return[SVGElement,HTMLImageElement,HTMLVideoElement].some((function(n){return e instanceof n}))},isRTL:function(){return"rtl"===document.documentElement.dir},queryElement:z,normalizeValue:I,normalizeOptions:function(e,n,t,i){var a=Object.assign({},e.dataset),r={},o={};return Object.keys(a).forEach((function(e){var n=e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return e.toLowerCase()})):e;o[n]=I(a[e])})),Object.keys(t).forEach((function(e){t[e]=I(t[e])})),Object.keys(n).forEach((function(e){r[e]=e in t?t[e]:e in o?o[e]:n[e]})),r},tryWrapper:function(e,n){try{e()}catch(e){throw TypeError(n+" "+e)}},reflow:function(e){return e.offsetHeight},Version:"0.2.15"}}));
{
"name": "shorter-js",
"version": "0.2.14",
"version": "0.2.15",
"description": "A small ES6+ library with various JavaScript tools useful for creating light libraries.",

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

@@ -0,1 +1,3 @@

// @ts-ignore
const { userAgentData } = navigator;
const appleBrands = /(iPhone|iPod|iPad)/;

@@ -5,5 +7,4 @@

* A global namespace for Apple browsers.
* @type {boolean}
*/
// @ts-ignore
const { userAgentData } = navigator;
const isApple = !userAgentData ? appleBrands.test(navigator.userAgent)

@@ -10,0 +11,0 @@ : userAgentData.brands.some((x) => appleBrands.test(x.brand));

@@ -75,3 +75,3 @@ import queryElement from './queryElement';

* An alias for `Data.get()`.
* @param {Element} element target element
* @param {Element | string} element target element
* @param {string} component the component's name or a unique key

@@ -78,0 +78,0 @@ * @returns {any} the request result

@@ -352,3 +352,3 @@ declare module "shorter-js/src/strings/ariaChecked" {

declare module "shorter-js/src/misc/data" {
export function getInstance(element: Element, component: string): any;
export function getInstance(element: Element | string, component: string): any;
export default Data;

@@ -424,3 +424,3 @@ namespace Data {

export default isApple;
const isApple: any;
const isApple: boolean;
}

@@ -427,0 +427,0 @@ declare module "shorter-js/src/misc/isElementInScrollRange" {

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc