Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mount-image

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mount-image - npm Package Compare versions

Comparing version 1.2.0-beta.1 to 1.2.0-beta.2

6

dist/index.esm-browser.js

@@ -0,1 +1,7 @@

/*!
* mount-image v1.2.0-beta.2
* A simple function for mounting image
* (c) 2021-2023 saqqdy<https://github.com/saqqdy>
* Released under the MIT License.
*/
/**

@@ -2,0 +8,0 @@ * Dynamic loading of image resources

8

dist/index.esm-browser.prod.js

@@ -1,1 +0,7 @@

function e(e,r){if(r===void 0){r={}}if(!e)throw new Error("[mountImage]: url is required");var o=r.attrs,t=r.props,n=r.force,a=n===void 0?false:n;return new Promise((function(r,n){if(!a&&document.querySelector('img[src="'.concat(e,'"]'))){r(true);return}var i=document.createElement("img");var d,c;if(o){for(d in o){i[d]=o[d]}}if(t){for(c in t){i[c]=t[c]}}i.src=e;document.body.appendChild(i);i.onload=i.onreadystatechange=function(){if(!i.readyState||["loaded","complete"].includes(i.readyState)){i.onload=i.onreadystatechange=null;r(true)}};i.onerror=n}))}export{e as default};
/*!
* mount-image v1.2.0-beta.2
* A simple function for mounting image
* (c) 2021-2023 saqqdy<https://github.com/saqqdy>
* Released under the MIT License.
*/
function e(e,o){if(void 0===o&&(o={}),!e)throw new Error("[mountImage]: url is required");var r=o.attrs,n=o.props,t=o.force,a=void 0!==t&&t;return new Promise((function(o,t){if(a||!document.querySelector('img[src="'.concat(e,'"]'))){var d,i,c=document.createElement("img");if(r)for(d in r)c[d]=r[d];if(n)for(i in n)c[i]=n[i];c.src=e,document.body.appendChild(c),c.onload=c.onreadystatechange=function(){c.readyState&&!["loaded","complete"].includes(c.readyState)||(c.onload=c.onreadystatechange=null,o(!0))},c.onerror=t}else o(!0)}))}export{e as default};

4

dist/index.global.js
/*!
* mount-image v1.2.0-beta.1
* mount-image v1.2.0-beta.2
* A simple function for mounting image

@@ -7,3 +7,3 @@ * (c) 2021-2023 saqqdy<https://github.com/saqqdy>

*/
this.jsCool = (function () {
this.mountImage = (function () {
'use strict';

@@ -10,0 +10,0 @@

@@ -1,1 +0,7 @@

this.jsCool=function(){"use strict";function e(e,r){if(r===void 0){r={}}if(!e)throw new Error("[mountImage]: url is required");var o=r.attrs,t=r.props,n=r.force,i=n===void 0?false:n;return new Promise((function(r,n){if(!i&&document.querySelector('img[src="'.concat(e,'"]'))){r(true);return}var a=document.createElement("img");var c,u;if(o){for(c in o){a[c]=o[c]}}if(t){for(u in t){a[u]=t[u]}}a.src=e;document.body.appendChild(a);a.onload=a.onreadystatechange=function(){if(!a.readyState||["loaded","complete"].includes(a.readyState)){a.onload=a.onreadystatechange=null;r(true)}};a.onerror=n}))}return e}();
/*!
* mount-image v1.2.0-beta.2
* A simple function for mounting image
* (c) 2021-2023 saqqdy<https://github.com/saqqdy>
* Released under the MIT License.
*/
this.mountImage=function(){"use strict";return function(e,r){if(void 0===r&&(r={}),!e)throw new Error("[mountImage]: url is required");var n=r.attrs,o=r.props,t=r.force,a=void 0!==t&&t;return new Promise((function(r,t){if(a||!document.querySelector('img[src="'.concat(e,'"]'))){var i,c,d=document.createElement("img");if(n)for(i in n)d[i]=n[i];if(o)for(c in o)d[c]=o[c];d.src=e,document.body.appendChild(d),d.onload=d.onreadystatechange=function(){d.readyState&&!["loaded","complete"].includes(d.readyState)||(d.onload=d.onreadystatechange=null,r(!0))},d.onerror=t}else r(!0)}))}}();
{
"name": "mount-image",
"description": "A simple function for mounting image",
"version": "1.2.0-beta.1",
"packageManager": "pnpm@8.5.1",
"version": "1.2.0-beta.2",
"packageManager": "pnpm@8.6.0",
"main": "dist/index.cjs.js",

@@ -7,0 +7,0 @@ "module": "dist/index.esm-bundler.js",

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