New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gez/import

Package Overview
Dependencies
Maintainers
0
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gez/import - npm Package Compare versions

Comparing version 0.0.15-alpha.73 to 0.0.15-alpha.74

8

package.json

@@ -14,4 +14,4 @@ {

"@biomejs/biome": "1.9.2",
"@gez/core": "^0.0.15-alpha.73",
"@gez/lint": "^0.0.15-alpha.73",
"@gez/core": "^0.0.15-alpha.74",
"@gez/lint": "^0.0.15-alpha.74",
"@types/node": "20.12.12",

@@ -24,3 +24,3 @@ "@vitest/coverage-v8": "1.6.0",

},
"version": "0.0.15-alpha.73",
"version": "0.0.15-alpha.74",
"type": "module",

@@ -44,3 +44,3 @@ "private": false,

],
"gitHead": "b23de49d4e0a42e017cceb8cb394859cc24592b0"
"gitHead": "c892b84276264d23a0b887132003a6dfe0331cba"
}

@@ -30,3 +30,4 @@ import fs from 'node:fs';

parent: string,
context: vm.Context
context: vm.Context,
cache = new Map<string, Promise<vm.SourceTextModule>>()
) {

@@ -57,25 +58,43 @@ if (isBuiltin(specifier)) {

const url = new URL(import.meta.resolve(specifier, parent));
const text = fs.readFileSync(url.pathname, 'utf-8');
const module: vm.SourceTextModule = new vm.SourceTextModule(text, {
initializeImportMeta: (meta) => {
meta.filename = filename;
meta.dirname = dirname;
meta.resolve = (specifier: string, parent: string | URL = url) => {
return import.meta.resolve(specifier, parent);
};
meta.url = url.toString();
},
identifier: specifier,
context: context,
// @ts-ignore
importModuleDynamically: (specifier, referrer) => {
const readFilename = url.pathname;
let module = cache.get(readFilename);
if (module) {
return module;
}
const build = async (): Promise<vm.SourceTextModule> => {
const text = fs.readFileSync(readFilename, 'utf-8');
const module = new vm.SourceTextModule(text, {
initializeImportMeta: (meta) => {
meta.filename = filename;
meta.dirname = dirname;
meta.resolve = (
specifier: string,
parent: string | URL = url
) => {
return import.meta.resolve(specifier, parent);
};
meta.url = url.toString();
},
identifier: specifier,
context: context,
// @ts-ignore
return moduleLinker(specifier, filename, referrer.context);
}
});
await module.link((specifier: string, referrer) => {
return moduleLinker(specifier, filename, referrer.context);
});
await module.evaluate();
importModuleDynamically: (specifier, referrer) => {
return moduleLinker(
specifier,
filename,
// @ts-ignore
referrer.context,
cache
);
}
});
await module.link((specifier: string, referrer) => {
return moduleLinker(specifier, filename, referrer.context, cache);
});
await module.evaluate();
return module;
};
module = build();
cache.set(readFilename, module);
return module;
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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