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

common-js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

common-js - npm Package Compare versions

Comparing version 0.3.5 to 0.3.6

8

common.js
/*! (C) 2017 Andrea Giammarchi */
if (typeof module === 'object') {
module.constructor.prototype.import = function (path) {
'import' in module || (module.constructor.prototype.import = function (path) {
var self = this;
return new Promise(function (resolve) {
resolve(self.require(path));
return Promise.resolve().then(function () {
return self.require(path);
});
};
});
} else {

@@ -10,0 +10,0 @@ (function CommonJS(info, el) {

/*! (C) 2017 Andrea Giammarchi */
"object"==typeof module?module.constructor.prototype["import"]=function(e){var t=this;return new Promise(function(n){n(t.require(e))})}:!function e(t,n){var r=/^[a-zA-Z_-]/,o=t._||n.getAttribute("data-main").replace(r,"./$&"),s=function(e){r.test(e)&&(e=m._path(e));for(var t,n=/^(?:[a-z]+:)?\/\//.test(e),s=n?e:o.slice(0,o.lastIndexOf("/")),c=n?0:e.length,i=0,u=0;i<c;u=i+1)if(i=e.indexOf("/",u),i<0)i=c,s+="/"+e.slice(u),/\.js$/i.test(s)||(s+=".js");else if(0===i)s="";else{for(t=u,u=i;u&&"."===e.charAt(u-1);)--u;switch(i-u){case 0:s+="/"+e.slice(t,i);break;case 1:break;case 2:s=s.slice(0,s.lastIndexOf("/"))}}return s},c=function(e,t,n){var r=document.documentElement,o=document.createElement("script");o.setAttribute("nonce",m._nonce),o.textContent="module.$(function(){var module="+m._cjs+'(arguments[0]),__filename=module.filename,__dirname=__filename.slice(0,__filename.lastIndexOf("/")),require=module.require,exports=module.exports;(function(){"use strict";\n'+e.responseText+";\n}.call(exports));return module.exports;}(module));",m._=t,m.$=function(e){n(m._cache[t]=e)},setTimeout(function(){r.removeChild(o)},1),r.appendChild(o)},i=function(e,t){throw m._cache[e]=new Error(t.statusText)},u=function(e){var t,n=e,r=/^((?:[a-z]+?:\/\/)?[^\/]+)\/([^@]+)@latest(\/.*)?$/.exec(e),o=function(e){t=e},s=new XMLHttpRequest;if(r){if(s.open("GET","http://www.3site.eu/latest/?@="+r[2],!1),s.send(null),!(s.status<400))return i(e,s);t=JSON.parse(s.responseText),n=r[1]+"/"+r[2]+"@"+t.version+(r[3]||"")}return s=new XMLHttpRequest,s.open("GET",n,!1),s.send(t=null),s.status<400?c(s,e,o):i(e,s),t},a={},l={filename:o,exports:a,require:function(e){var t=s(e);return m._cache[t]||u(t)},"import":function(e){var t=s(e);return Promise.resolve(m._cache[t]||(m._cache[t]=new Promise(function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400?c(r,t,e):n(new Error(r.statusText)))},r.send(null)})))}},m=window.module||l;return m===l&&(window.global=window,window.module=l,window.process={browser:!0},l._cache=Object.create(null),l._nonce=n.getAttribute("nonce"),l._cjs=""+e,l._path=function(e){var t=e.indexOf("/"),n=e.length;return"https://unpkg.com/"+e.slice(0,t<0?n:t)+"@latest"+(t<0?"":e.slice(t))},l["import"]("./"+o.split("/").pop())),l}({_:""},document.getElementById("common-js"));
"object"==typeof module?"import"in module||(module.constructor.prototype["import"]=function(e){var t=this;return Promise.resolve().then(function(){return t.require(e)})}):!function e(t,n){var r=/^[a-zA-Z_-]/,o=t._||n.getAttribute("data-main").replace(r,"./$&"),s=function(e){r.test(e)&&(e=m._path(e));for(var t,n=/^(?:[a-z]+:)?\/\//.test(e),s=n?e:o.slice(0,o.lastIndexOf("/")),i=n?0:e.length,u=0,c=0;u<i;c=u+1)if(u=e.indexOf("/",c),u<0)u=i,s+="/"+e.slice(c),/\.js$/i.test(s)||(s+=".js");else if(0===u)s="";else{for(t=c,c=u;c&&"."===e.charAt(c-1);)--c;switch(u-c){case 0:s+="/"+e.slice(t,u);break;case 1:break;case 2:s=s.slice(0,s.lastIndexOf("/"))}}return s},i=function(e,t,n){var r=document.documentElement,o=document.createElement("script");o.setAttribute("nonce",m._nonce),o.textContent="module.$(function(){var module="+m._cjs+'(arguments[0]),__filename=module.filename,__dirname=__filename.slice(0,__filename.lastIndexOf("/")),require=module.require,exports=module.exports;(function(){"use strict";\n'+e.responseText+";\n}.call(exports));return module.exports;}(module));",m._=t,m.$=function(e){n(m._cache[t]=e)},setTimeout(function(){r.removeChild(o)},1),r.appendChild(o)},u=function(e,t){throw m._cache[e]=new Error(t.statusText)},c=function(e){var t,n=e,r=/^((?:[a-z]+?:\/\/)?[^\/]+)\/([^@]+)@latest(\/.*)?$/.exec(e),o=function(e){t=e},s=new XMLHttpRequest;if(r){if(s.open("GET","http://www.3site.eu/latest/?@="+r[2],!1),s.send(null),!(s.status<400))return u(e,s);t=JSON.parse(s.responseText),n=r[1]+"/"+r[2]+"@"+t.version+(r[3]||"")}return s=new XMLHttpRequest,s.open("GET",n,!1),s.send(t=null),s.status<400?i(s,e,o):u(e,s),t},a={},l={filename:o,exports:a,require:function(e){var t=s(e);return m._cache[t]||c(t)},"import":function(e){var t=s(e);return Promise.resolve(m._cache[t]||(m._cache[t]=new Promise(function(e,n){var r=new XMLHttpRequest;r.open("GET",t,!0),r.onreadystatechange=function(){4==r.readyState&&(r.status<400?i(r,t,e):n(new Error(r.statusText)))},r.send(null)})))}},m=window.module||l;return m===l&&(window.global=window,window.module=l,window.process={browser:!0},l._cache=Object.create(null),l._nonce=n.getAttribute("nonce"),l._cjs=""+e,l._path=function(e){var t=e.indexOf("/"),n=e.length;return"https://unpkg.com/"+e.slice(0,t<0?n:t)+"@latest"+(t<0?"":e.slice(t))},l["import"]("./"+o.split("/").pop())),l}({_:""},document.getElementById("common-js"));

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

Dc2Yi71baawxeNAkVCdXfw0xROndLWentxGqnJZsAyY=
7giZujfBiq/Hh0AVAcH299goQUbkoEEOxF8XPkgmlEc=

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

OTkZQBXHHw/9zkezKj8lefsM6OCnZh9YcMxSYbSxwOw=
NN2EkKKBrjsqvNYMr/Jca6WMpVbz++M4PV8VIAp149o=
{
"name": "common-js",
"version": "0.3.5",
"version": "0.3.6",
"description": "module.exports and module.import for browsers too",

@@ -5,0 +5,0 @@ "main": "common.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