Socket
Socket
Sign inDemoInstall

@deckdeckgo/utils

Package Overview
Dependencies
0
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.1 to 2.1.0

2

lib/index.js

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

function f(e){return e.changedTouches?e.changedTouches[0]:e}function m(e,n){let t;return(...i)=>{let r=()=>e(...i);t&&clearTimeout(t),t=setTimeout(r,n&&n>0?n:300)}}function s(){return window?window.matchMedia("(any-pointer:coarse)").matches:!1}function p(){if(!window||!navigator)return!1;let e=o();return/iPhone|iPod/i.test(e)||a()}function a(){if(!window||!navigator)return!1;let e=o();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&s()}function g(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function b(){if(!window||!navigator)return!1;let e=o();return/firefox/i.test(e)}function x(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function w(){return!d()}function d(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var u=()=>{if(!window)return!1;let e=o();return/android|sink/i.test(e)},y=()=>{if(!window)return!1;let e=o();return u()&&!/mobile/i.test(e)},o=()=>navigator.userAgent||navigator.vendor||window.opera;function h(e){return new Promise(n=>{if(!e){n();return}e.forEach(t=>{t.hasAttribute("data-src")&&(t.setAttribute("src",`${t.getAttribute("data-src")}`),t.removeAttribute("data-src"),t.classList.contains("deckgo-reveal")||t.style.setProperty("visibility","inherit")),t.style.setProperty("pointer-events","none")}),n()})}function S(e){return new Promise(n=>{if(!e){n();return}e.forEach(async t=>{await t.lazyLoad()}),n()})}function L(e,n){return new Promise((t,i)=>{if(document.getElementById(e)){t("JS already loaded.");return}let r=document.createElement("script");r.id=e,r.async=!0,r.defer=!0,r.src=n,r.addEventListener("load",()=>t("JS loaded.")),r.addEventListener("error",()=>i("Error loading script.")),r.addEventListener("abort",()=>i("Script loading aborted.")),document.head.appendChild(r)})}function P(e,n){return new Promise((t,i)=>{if(document.getElementById(e)){t("CSS already loaded.");return}let r=document.createElement("link");r.id=e,r.setAttribute("rel","stylesheet"),r.setAttribute("href",n),r.addEventListener("load",()=>t("CSS loaded.")),r.addEventListener("error",()=>i("Error loading css.")),r.addEventListener("abort",()=>i("CSS loading aborted.")),document.head.appendChild(r)})}async function T(e){if(!e||e===void 0||e==="")return;let n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return n?`${parseInt(n[1],16)}, ${parseInt(n[2],16)}, ${parseInt(n[3],16)}`:void 0}async function M(e){return e?(t=>{if(!!t)return`#${t.map(i=>i.toString(16).padStart(2,"0")).join("")}`})(c(e)):void 0}function c(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,3).map(t=>Number(t))}function I(e){let n=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!n)return n.splice(1,4).map(t=>Number(t))}export{m as debounce,c as extractRgb,I as extractRgba,T as hexToRgb,P as injectCSS,L as injectJS,u as isAndroid,y as isAndroidTablet,b as isFirefox,g as isFullscreen,p as isIOS,a as isIPad,w as isLandscape,s as isMobile,d as isPortrait,x as isRTL,h as lazyLoadSelectedImages,S as lazyLoadSelectedLazyImagesComponent,M as rgbToHex,f as unifyEvent};
function l(e){return e.changedTouches?e.changedTouches[0]:e}function f(e,t){let n;return(...i)=>{let r=()=>e(...i);n&&clearTimeout(n),n=setTimeout(r,t&&t>0?t:300)}}function s(){if(!window)return!1;let e=window.matchMedia("(any-pointer:coarse)").matches,t=window.matchMedia("(any-pointer:fine)").matches;return e&&!t}function m(){if(!window||!navigator)return!1;let e=o();return/iPhone|iPod/i.test(e)||a()}function a(){if(!window||!navigator)return!1;let e=o();return/iPad/i.test(e)?!0:/Macintosh/i.test(e)&&s()}function p(){return!!(document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)}function g(){if(!window||!navigator)return!1;let e=o();return/firefox/i.test(e)}function b(){let e=document.documentElement.getAttribute("dir");return e!==null&&e==="rtl"}function x(){return!d()}function d(){return window?window.matchMedia&&window.matchMedia("(orientation: portrait)").matches:!1}var u=()=>{if(!window)return!1;let e=o();return/android|sink/i.test(e)},w=()=>{if(!window)return!1;let e=o();return u()&&!/mobile/i.test(e)},o=()=>navigator.userAgent||navigator.vendor||window.opera;function y(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()})}function E(e){return new Promise(t=>{if(!e){t();return}e.forEach(async n=>{await n.lazyLoad()}),t()})}function v(e,t){return new Promise((n,i)=>{if(document.getElementById(e)){n("JS already loaded.");return}let r=document.createElement("script");r.id=e,r.async=!0,r.defer=!0,r.src=t,r.addEventListener("load",()=>n("JS loaded.")),r.addEventListener("error",()=>i("Error loading script.")),r.addEventListener("abort",()=>i("Script loading aborted.")),document.head.appendChild(r)})}function L(e,t){return new Promise((n,i)=>{if(document.getElementById(e)){n("CSS already loaded.");return}let r=document.createElement("link");r.id=e,r.setAttribute("rel","stylesheet"),r.setAttribute("href",t),r.addEventListener("load",()=>n("CSS loaded.")),r.addEventListener("error",()=>i("Error loading css.")),r.addEventListener("abort",()=>i("CSS loading aborted.")),document.head.appendChild(r)})}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 T(e){return e?(n=>{if(!!n)return`#${n.map(i=>i.toString(16).padStart(2,"0")).join("")}`})(c(e)):void 0}function c(e){let t=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!t)return t.splice(1,3).map(n=>Number(n))}function M(e){let t=e.match(/([.\d]+),\s*([.\d]+),\s*([.\d]+),\s*([.\d]+)/);if(!!t)return t.splice(1,4).map(n=>Number(n))}export{f as debounce,c as extractRgb,M as extractRgba,A as hexToRgb,L as injectCSS,v as injectJS,u as isAndroid,w as isAndroidTablet,g as isFirefox,p as isFullscreen,m as isIOS,a as isIPad,x as isLandscape,s as isMobile,d as isPortrait,b as isRTL,y as lazyLoadSelectedImages,E as lazyLoadSelectedLazyImagesComponent,T as rgbToHex,l as unifyEvent};
//# sourceMappingURL=index.js.map
{
"name": "@deckdeckgo/utils",
"version": "2.0.1",
"version": "2.1.0",
"author": "David Dal Busco",

@@ -9,13 +9,8 @@ "description": "A collection of utils methods and functions developed for DeckDeckGo",

"type": "git",
"url": "git://github.com/deckgo/deckdeckgo.git"
"url": "git://github.com/deckgo/deckdeckgo.git",
"directory": "utils/utils"
},
"homepage": "https://deckdeckgo.com",
"devDependencies": {
"@types/node": "^15.3.0",
"esbuild": "^0.11.22",
"husky": "^6.0.0",
"prettier": "2.3.0",
"pretty-quick": "^3.1.0",
"rimraf": "^3.0.2",
"typescript": "^4.2.4"
"@types/node": "^16.9.0"
},

@@ -26,3 +21,2 @@ "main": "lib/index.js",

"scripts": {
"prepare": "npm run build",
"ts-declaration": " tsc --emitDeclarationOnly --outDir lib",

@@ -34,8 +28,3 @@ "build": "rimraf lib && node ./esbuild.js && npm run ts-declaration"

"README.md"
],
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
]
}

@@ -7,3 +7,3 @@ [![npm][npm-badge]][npm-badge-url]

[npm-license]: https://img.shields.io/npm/l/@deckdeckgo/utils
[npm-license-url]: https://github.com/deckgo/deckdeckgo/blob/master/utils/utils/LICENSE
[npm-license-url]: https://github.com/deckgo/deckdeckgo/blob/main/utils/utils/LICENSE

@@ -16,17 +16,6 @@ # DeckDeckGo - Utils

- [Getting Started](#getting-started)
-
- [Methods](#methods)
- [License](#license)
## Getting Started
If you would like to install and compile locally this project, proceed as following:
```
git clone https://github.com/deckgo/deckdeckgo
cd deckdeckgo/utils/utils
npm install
npm run build
```
## Methods

@@ -33,0 +22,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc