Socket
Socket
Sign inDemoInstall

@deckdeckgo/utils

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@deckdeckgo/utils - npm Package Compare versions

Comparing version 2.4.0 to 3.0.0

2

lib/index.js

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

function f(e){return e.changedTouches?e.changedTouches[0]:e}function p(e,t){let n;return(...r)=>{let o=()=>e(...r);n&&clearTimeout(n),n=setTimeout(o,t&&t>0?t:300)}}function d(){if(!window)return!1;let e=window.matchMedia("(any-pointer:coarse)").matches,t=window.matchMedia("(any-pointer:fine)").matches;return e&&!t}function g(){if(!window||!navigator)return!1;let e=i();return/iPhone|iPod/i.test(e)||a()}function a(){if(!window||!navigator)return!1;let e=i();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&d()}function w(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function x(){if(!window||!navigator)return!1;let e=i();return/firefox/i.test(e)}function y(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function b(){return!c()}function c(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var l=()=>{if(!window)return!1;let e=i();return/android|sink/i.test(e)},E=()=>{if(!window)return!1;let e=i();return l()&&!/mobile/i.test(e)},i=()=>navigator.userAgent||navigator.vendor||window.opera;function h(e){return new Promise(t=>{if(!e){t();return}e.forEach(n=>{n.hasAttribute("data-src")&&(n.setAttribute("src",`${n.getAttribute("data-src")}`),n.removeAttribute("data-src"),n.classList.contains("deckgo-reveal")||n.style.setProperty("visibility","inherit")),n.style.setProperty("pointer-events","none")}),t()})}var T=async e=>{let t=e.map(n=>n.lazyLoad());await Promise.all(t)};function L(e,t){return new Promise((n,r)=>{if(document.getElementById(e)){n("JS already loaded.");return}let o=document.createElement("script");o.id=e,o.async=!0,o.defer=!0,o.src=t,o.addEventListener("load",()=>n("JS loaded.")),o.addEventListener("error",()=>r("Error loading script.")),o.addEventListener("abort",()=>r("Script loading aborted.")),document.head.appendChild(o)})}function M(e,t){return new Promise((n,r)=>{if(document.getElementById(e)){n("CSS already loaded.");return}let o=document.createElement("link");o.id=e,o.setAttribute("rel","stylesheet"),o.setAttribute("href",t),o.addEventListener("load",()=>n("CSS loaded.")),o.addEventListener("error",()=>r("Error loading css.")),o.addEventListener("abort",()=>r("CSS loading aborted.")),document.head.appendChild(o)})}async function A(e){if(!e||e===void 0||e==="")return;let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?`${parseInt(t[1],16)}, ${parseInt(t[2],16)}, ${parseInt(t[3],16)}`:void 0}async function N(e){return e?(n=>{if(!!n)return`#${n.map(r=>r.toString(16).padStart(2,"0")).join("")}`})(u(e)):void 0}function u(e){let t=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!t)return t.splice(1,3).map(n=>Number(n))}function R(e){let t=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!t)return t.splice(1,4).map(n=>Number(n))}var H=()=>{window&&window.getSelection?window.getSelection()?.empty?window.getSelection()?.empty():window.getSelection()?.removeAllRanges&&window.getSelection()?.removeAllRanges():document&&document.selection&&document.selection.empty()},m=()=>window&&window.getSelection?window.getSelection():document&&document.getSelection?document.getSelection():document&&document.selection?document.selection.createRange().text:null,I=e=>{let t=e?.anchorNode;return t?t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement:null},k=e=>{s({element:e,collapse:"end"})},z=e=>{s({element:e,collapse:"start"})},s=({element:e,collapse:t})=>{if(!e)return;let n=document.createRange();n.selectNodeContents(e),n.collapse(t==="start");let r=m();r?.removeAllRanges(),r?.addRange(n),n.detach()};var F=e=>{e?.key==="Tab"&&(e.preventDefault(),document.execCommand("insertHTML",!1,"&#009"))};export{F as catchTab,H as clearTheSelection,p as debounce,u as extractRgb,R as extractRgba,I as getAnchorElement,m as getSelection,A as hexToRgb,M as injectCSS,L as injectJS,l as isAndroid,E as isAndroidTablet,x as isFirefox,w as isFullscreen,g as isIOS,a as isIPad,b as isLandscape,d as isMobile,c as isPortrait,y as isRTL,h as lazyLoadSelectedImages,T as lazyLoadSelectedLazyImagesComponent,k as moveCursorToEnd,z as moveCursorToStart,N as rgbToHex,f as unifyEvent};
function f(e){return e.changedTouches?e.changedTouches[0]:e}function p(e,t){let n;return(...r)=>{let o=()=>e(...r);n&&clearTimeout(n),n=setTimeout(o,t&&t>0?t:300)}}function d(){if(!window)return!1;let e=window.matchMedia("(any-pointer:coarse)").matches,t=window.matchMedia("(any-pointer:fine)").matches;return e&&!t}function g(){if(!window||!navigator)return!1;let e=i();return/iPhone|iPod/i.test(e)||a()}function a(){if(!window||!navigator)return!1;let e=i();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&d()}function w(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function x(){if(!window||!navigator)return!1;let e=i();return/firefox/i.test(e)}function b(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function y(){return!c()}function c(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var l=()=>{if(!window)return!1;let e=i();return/android|sink/i.test(e)},E=()=>{if(!window)return!1;let e=i();return l()&&!/mobile/i.test(e)},i=()=>navigator.userAgent||navigator.vendor||window.opera;function h(e){return new Promise(t=>{if(!e){t();return}e.forEach(n=>{n.hasAttribute("data-src")&&(n.setAttribute("src",`${n.getAttribute("data-src")}`),n.removeAttribute("data-src"),n.classList.contains("deckgo-reveal")||n.style.setProperty("visibility","inherit")),n.style.setProperty("pointer-events","none")}),t()})}var T=async e=>{let t=e.map(n=>n.lazyLoad());await Promise.all(t)};function L(e,t){return new Promise((n,r)=>{if(document.getElementById(e)){n("JS already loaded.");return}let o=document.createElement("script");o.id=e,o.async=!0,o.defer=!0,o.src=t,o.addEventListener("load",()=>n("JS loaded.")),o.addEventListener("error",()=>r("Error loading script.")),o.addEventListener("abort",()=>r("Script loading aborted.")),document.head.appendChild(o)})}function M(e,t){return new Promise((n,r)=>{if(document.getElementById(e)){n("CSS already loaded.");return}let o=document.createElement("link");o.id=e,o.setAttribute("rel","stylesheet"),o.setAttribute("href",t),o.addEventListener("load",()=>n("CSS loaded.")),o.addEventListener("error",()=>r("Error loading css.")),o.addEventListener("abort",()=>r("CSS loading aborted.")),document.head.appendChild(o)})}function P(e){if(!e||e===void 0||e==="")return;let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?`${parseInt(t[1],16)}, ${parseInt(t[2],16)}, ${parseInt(t[3],16)}`:void 0}function N(e){return e?(n=>{if(!!n)return`#${n.map(r=>r.toString(16).padStart(2,"0")).join("")}`})(u(e)):void 0}function u(e){let t=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!t)return t.splice(1,3).map(n=>Number(n))}function R(e){let t=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!t)return t.splice(1,4).map(n=>Number(n))}var H=()=>{window&&window.getSelection?window.getSelection()?.empty?window.getSelection()?.empty():window.getSelection()?.removeAllRanges&&window.getSelection()?.removeAllRanges():document&&document.selection&&document.selection.empty()},m=()=>window&&window.getSelection?window.getSelection():document&&document.getSelection?document.getSelection():document&&document.selection?document.selection.createRange().text:null,I=e=>{let t=e?.anchorNode;return t?t.nodeType!==Node.TEXT_NODE&&t.nodeType!==Node.COMMENT_NODE?t:t.parentElement:null},k=e=>{s({element:e,collapse:"end"})},z=e=>{s({element:e,collapse:"start"})},s=({element:e,collapse:t})=>{if(!e)return;let n=document.createRange();n.selectNodeContents(e),n.collapse(t==="start");let r=m();r?.removeAllRanges(),r?.addRange(n),n.detach()};var F=e=>{e?.key==="Tab"&&(e.preventDefault(),document.execCommand("insertHTML",!1,"&#009"))};export{F as catchTab,H as clearTheSelection,p as debounce,u as extractRgb,R as extractRgba,I as getAnchorElement,m as getSelection,P as hexToRgb,M as injectCSS,L as injectJS,l as isAndroid,E as isAndroidTablet,x as isFirefox,w as isFullscreen,g as isIOS,a as isIPad,y as isLandscape,d as isMobile,c as isPortrait,b as isRTL,h as lazyLoadSelectedImages,T as lazyLoadSelectedLazyImagesComponent,k as moveCursorToEnd,z as moveCursorToStart,N as rgbToHex,f as unifyEvent};
//# sourceMappingURL=index.js.map

@@ -1,4 +0,4 @@

export declare function hexToRgb(hex: string): Promise<string | undefined>;
export declare function rgbToHex(rgb: string | undefined): Promise<string | undefined>;
export declare function hexToRgb(hex: string | undefined): string | undefined;
export declare function rgbToHex(rgb: string | undefined): string | undefined;
export declare function extractRgb(rgb: string): number[] | undefined;
export declare function extractRgba(rgb: string): number[] | undefined;
{
"name": "@deckdeckgo/utils",
"version": "2.4.0",
"version": "3.0.0",
"author": "David Dal Busco",

@@ -5,0 +5,0 @@ "description": "A collection of utils methods and functions developed for DeckDeckGo",

Sorry, the diff of this file is not supported yet

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