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

@chialab/esbuild-plugin-meta-url

Package Overview
Dependencies
Maintainers
2
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chialab/esbuild-plugin-meta-url - npm Package Compare versions

Comparing version 0.12.31 to 0.12.34

14

lib/index.js

@@ -124,3 +124,3 @@ import path from 'path';

sourcesContent,
}, async ({ magicCode, code, ast }) => {
}, async (data) => {
/**

@@ -136,3 +136,3 @@ * @type {{ [key: string]: string }}

walk(ast, {
walk(data.ast, {
/**

@@ -142,3 +142,3 @@ * @param {*} node

NewExpression(node) {
const value = getMetaUrl(node, ast);
const value = getMetaUrl(node, data.ast);
if (typeof value !== 'string' || isUrl(value)) {

@@ -150,11 +150,11 @@ return;

const resolvedPath = await resolve(value, args.path);
const startOffset = getOffsetFromLocation(code, node.loc.start);
const endOffset = getOffsetFromLocation(code, node.loc.end);
const startOffset = getOffsetFromLocation(data.code, node.loc.start);
const endOffset = getOffsetFromLocation(data.code, node.loc.end);
if (!ids[resolvedPath]) {
const entryPoint = emitFileOrChunk(build, resolvedPath);
const { identifier } = prependImportStatement({ ast, magicCode, code }, entryPoint, value);
const { identifier } = prependImportStatement(data, entryPoint, value);
ids[resolvedPath] = identifier;
}
magicCode.overwrite(startOffset, endOffset, `new URL(${ids[resolvedPath]}, ${getBaseUrl(build)})`);
data.magicCode.overwrite(startOffset, endOffset, `new URL(${ids[resolvedPath]}, ${getBaseUrl(build)})`);
})());

@@ -161,0 +161,0 @@ },

{
"name": "@chialab/esbuild-plugin-meta-url",
"type": "module",
"version": "0.12.31",
"version": "0.12.34",
"description": "A file loader plugin for esbuild for constructed URLs using import metadata.",

@@ -47,3 +47,3 @@ "main": "lib/index.js",

},
"gitHead": "f04714a9a45a079d611e07e20c12ff2380f473e6"
"gitHead": "6b332aab5614a4d081f931451c04471bff3e3147"
}
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