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

@parcel/runtime-js

Package Overview
Dependencies
Maintainers
1
Versions
887
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parcel/runtime-js - npm Package Compare versions

Comparing version 2.0.0-nightly.87 to 2.0.0-nightly.88

lib/get-worker-url.js

14

lib/bundle-url.js

@@ -30,5 +30,17 @@ "use strict";

return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/';
} // TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.
function getOrigin(url) {
let matches = ('' + url).match(/(https?|file|ftp):\/\/[^/]+/);
if (!matches) {
throw new Error('Origin not found');
}
return matches[0];
}
exports.getBundleURL = getBundleURLCached;
exports.getBaseURL = getBaseURL;
exports.getBaseURL = getBaseURL;
exports.getOrigin = getOrigin;

@@ -172,9 +172,19 @@ "use strict";

function getURLRuntime(dependency, bundle, externalBundle) {
let relativePath = (0, _utils.relativeBundlePath)(bundle, externalBundle, {
leadingDotSlash: false
});
if (dependency.meta.webworker === true) {
return {
filePath: __filename,
code: `module.exports = require('./get-worker-url')(${JSON.stringify(relativePath)});`,
dependency
};
}
return {
filePath: __filename,
code: `module.exports = require('./bundle-url').getBundleURL() + ${JSON.stringify((0, _utils.relativeBundlePath)(bundle, externalBundle, {
leadingDotSlash: false
}))}`,
code: `module.exports = require('./bundle-url').getBundleURL() + ${JSON.stringify(relativePath)}`,
dependency
};
}

8

package.json
{
"name": "@parcel/runtime-js",
"version": "2.0.0-nightly.87+fc51ae3d",
"version": "2.0.0-nightly.88+7f447bec",
"license": "MIT",

@@ -19,6 +19,6 @@ "publishConfig": {

"dependencies": {
"@parcel/plugin": "2.0.0-nightly.87+fc51ae3d",
"@parcel/utils": "2.0.0-nightly.87+fc51ae3d"
"@parcel/plugin": "2.0.0-nightly.88+7f447bec",
"@parcel/utils": "2.0.0-nightly.88+7f447bec"
},
"gitHead": "fc51ae3db26fed5c400ef0c02d4f2a0a6623b9aa"
"gitHead": "7f447bec1eaf6d16b64114658b0be67ae042bea5"
}

@@ -30,3 +30,13 @@ var bundleURL = null;

// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.
function getOrigin(url) {
let matches = ('' + url).match(/(https?|file|ftp):\/\/[^/]+/);
if (!matches) {
throw new Error('Origin not found');
}
return matches[0];
}
exports.getBundleURL = getBundleURLCached;
exports.getBaseURL = getBaseURL;
exports.getOrigin = getOrigin;

@@ -188,8 +188,20 @@ // @flow strict-local

): RuntimeAsset {
let relativePath = relativeBundlePath(bundle, externalBundle, {
leadingDotSlash: false,
});
if (dependency.meta.webworker === true) {
return {
filePath: __filename,
code: `module.exports = require('./get-worker-url')(${JSON.stringify(
relativePath,
)});`,
dependency,
};
}
return {
filePath: __filename,
code: `module.exports = require('./bundle-url').getBundleURL() + ${JSON.stringify(
relativeBundlePath(bundle, externalBundle, {
leadingDotSlash: false,
}),
relativePath,
)}`,

@@ -196,0 +208,0 @@ dependency,

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