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

esmock

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esmock - npm Package Compare versions

Comparing version 1.8.1 to 1.8.2

2

package.json
{
"name": "esmock",
"version": "1.8.1",
"version": "1.8.2",
"license": "MIT",

@@ -5,0 +5,0 @@ "readmeFilename": "README.md",

@@ -18,7 +18,15 @@ import fs from 'fs';

// https://url.spec.whatwg.org/, eg, file:///C:/demo file://root/linux/path
const pathAddProtocol = (pathFull, protocol) => (
(protocol || (resolvewith.iscoremodule(pathFull) ? 'node:' : 'file:///'))
+ pathFull.replace(/^\//, ''));
const FILE_PROTOCOL = 'file:///';
// https://url.spec.whatwg.org/, eg, file:///C:/demo file:///root/linux/path
const pathAddProtocol = (pathFull, protocol) => {
if (!protocol)
protocol = !resolvewith.iscoremodule(pathFull) ? FILE_PROTOCOL : 'node:';
if (protocol.includes(FILE_PROTOCOL))
pathFull = fs.realpathSync.native(pathFull);
if (process.platform === 'win32')
pathFull = pathFull.split(path.sep).join(path.posix.sep);
return `${protocol}${pathFull.replace(/^\//, '')}`;
}
const esmockModuleMergeDefault = (defaultLive, defaultMock, merged) => {

@@ -169,3 +177,3 @@ const defaultLiveIsObj = isObj(defaultLive);

const esmockKeyLong = pathAddProtocol(pathModuleFull, 'file:///') + '?'
const esmockKeyLong = pathAddProtocol(pathModuleFull, FILE_PROTOCOL) + '?'
+ 'key=:esmockKey?esmockGlobals=:esmockGlobals#esmockModuleKeys=:moduleKeys'

@@ -178,3 +186,3 @@ .replace(/:esmockKey/, esmockKey)

return pathAddProtocol(pathModuleFull, 'file:///') + `?esmk=${esmockKey}`;
return pathAddProtocol(pathModuleFull, FILE_PROTOCOL) + `?esmk=${esmockKey}`;
};

@@ -181,0 +189,0 @@

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