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

@bazel/terser

Package Overview
Dependencies
Maintainers
6
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bazel/terser - npm Package Compare versions

Comparing version 4.6.1 to 5.0.0-rc.0

45

index.js

@@ -29,2 +29,41 @@ #!/usr/bin/env node

// Returns a single quotes version of str
function singleQuotes(str) {
return `'${str.replace(/'/g, '').replace(/"/g, '')}'`;
}
// Ensures that args are well formed.
// Work-around for an issue on Windows when exec bin path is not quoted.
// In --source-map, base=bazel-out/x64_windows-opt-exec-2B5CBBC6/bin must
// be quoted such as base='bazel-out/x64_windows-opt-exec-2B5CBBC6/bin' pr
// terser fails with
// ERROR: `includeSources,base=bazel-out/x64_windows-opt-exec-2B5CBBC6/bin,content=inline,url=bundle.min.js.map` is not a supported option
function fixArgs(args) {
const sourceMapIndex = args.indexOf('--source-map');
if (sourceMapIndex === -1) {
return args;
}
let sourceMapOptions = args[sourceMapIndex + 1].split(',');
sourceMapOptions = sourceMapOptions.map(o => {
const s = o.split('=');
if (s.length == 1) {
return o;
}
switch (s[0]) {
case 'base':
case 'content':
case 'url':
return `${s[0]}=${singleQuotes(s[1])}`;
default:
return o;
}
});
return [
...args.slice(0, sourceMapIndex + 1),
sourceMapOptions.join(','),
...args.slice(sourceMapIndex + 2),
];
}
/**

@@ -39,4 +78,6 @@ * Replaces directory url with the outputFile name in the url option of source-map argument

let sourceMapOptions = residualArgs[sourceMapIndex + 1].split(',');
// set the correct sourcemap url for this output file
let sourceMapOptions = residualArgs[sourceMapIndex + 1].split(',').map(
sourceMapOptions = sourceMapOptions.map(
o => o.startsWith('url=') ? `url='${path.basename(outputFile)}.map'` : o);

@@ -148,2 +189,4 @@

function main() {
process.argv = fixArgs(process.argv)
// Peek at the arguments to find any directories declared as inputs

@@ -150,0 +193,0 @@ let argv = process.argv.slice(2);

2

package.json

@@ -8,3 +8,3 @@ {

"license": "Apache-2.0",
"version": "4.6.1",
"version": "5.0.0-rc.0",
"repository": {

@@ -11,0 +11,0 @@ "type" : "git",

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