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

mount-script

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-script - 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-script v1.2.0-beta.2
* A simple function for mounting javascript
* (c) 2021-2023 saqqdy<https://github.com/saqqdy>
* Released under the MIT License.
*/
/**

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

4

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

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

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

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

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

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