Huge News!Announcing our $40M Series B led by Abstract Ventures.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.18.1 to 0.18.2

24

lib/index.js

@@ -7,6 +7,26 @@ import { Buffer } from 'buffer';

import { getBlock, getIdentifierValue, getLocation, parse, TokenType, walk } from '@chialab/estransform';
import { getSearchParam, isUrl } from '@chialab/node-resolve';
import mime from 'mime-types';
/**
* Check if the given path is a valid url.
* @param {string} url
*/
function isUrl(url) {
try {
return !!new URL(url);
} catch (err) {
//
}
return false;
}
/**
* Get hash param (if available) in the url.
* @param {string} source
*/
export function getHashParam(source) {
return new URLSearchParams(source.split('?').slice(1).join('?')).get('hash') || null;
}
/**
* @param {import('@chialab/estransform').TokenProcessor} processor Token processor.

@@ -165,3 +185,3 @@ * @returns {string|undefined} The path value.

const id = getSearchParam(value, 'hash');
const id = getHashParam(value);
if (id && build.isEmittedPath(id)) {

@@ -168,0 +188,0 @@ return;

5

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

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

"@chialab/esbuild-rna": "^0.18.1",
"@chialab/estransform": "^0.18.0",
"@chialab/node-resolve": "^0.18.0",
"@chialab/estransform": "^0.18.1",
"mime-types": "^2.1.35"

@@ -38,0 +37,0 @@ },

/**
* Get hash param (if available) in the url.
* @param {string} source
*/
export function getHashParam(source: string): string | null;
/**
* @param {import('@chialab/estransform').TokenProcessor} processor Token processor.
* @returns {string|undefined} The path value.
*/
export function getMetaUrl(processor: any): string | undefined;
export function getMetaUrl(processor: import("sucrase/dist/types/TokenProcessor").default): string | undefined;
/**

@@ -7,0 +12,0 @@ * @typedef {{ emit?: boolean }} PluginOptions

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