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

ecma-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ecma-webpack-plugin - npm Package Compare versions

Package version was removed
This package version has been unpublished, mostly likely due to security reasons

Comparing version

to
1.2.0-rc.067c8e1

30

lib/errors/index.js

@@ -22,4 +22,30 @@ const { parse } = require('acorn');

parse(content, parser);
} catch ({ message }) {
accumulator.push({ name, message });
} catch (error) {
const { message, loc: { line, column } = {}, raisedAt } = error;
const issue = { name, message };
if (line && column) {
const lineOfCode = (content || '').split('\n')[line - 1];
const [ prefix, startFrom, indentation ] = column > 20
? [ '...', column - 17, 20 ]
: [ '', 0, raisedAt ]
;
const [ suffix, endAt ] = lineOfCode.length - column > 30
? [ '...', column + 27 ]
: [ '', lineOfCode.length ]
;
const snippet = lineOfCode.substring(startFrom, endAt);
const pointer = [
' '.repeat(indentation),
'^',
].join('');
issue.content = [
prefix,
snippet,
suffix,
'\n',
pointer,
].join('');
}
accumulator.push(issue);
}

@@ -26,0 +52,0 @@

9

lib/message/index.js

@@ -8,5 +8,5 @@ const { red, yellow } = require('chalk');

*/
module.exports = errors => errors
module.exports = (errors) => errors
.map(
({ name, message }) => [
({ name, message, content }) => [
red('Found parsing errors in '),

@@ -16,3 +16,6 @@ yellow(name),

message,
].join(''),
content && '\n',
content,
].filter(Boolean).join(''),
).join('\n');
{
"name": "ecma-webpack-plugin",
"version": "1.1.0",
"version": "1.2.0-rc.067c8e1",
"description": "🧳 Verify your output code is compliant to the version you're targeting",

@@ -26,4 +26,4 @@ "keywords": [

"dependencies": {
"acorn": "^8.0.4",
"chalk": "^4.1.0"
"acorn": "^8.1.0",
"chalk": "^4.1.2"
},

@@ -33,8 +33,8 @@ "devDependencies": {

"abuser": "^2.0.3",
"chai": "^4.2.0",
"eslint": "^7.11.0",
"mocha": "^8.2.0",
"sinon": "^9.2.0",
"sinon-chai": "^3.5.0"
"chai": "^4.3.4",
"eslint": "^8.8.0",
"mocha": "^9.2.0",
"sinon": "^13.0.0",
"sinon-chai": "^3.6.0"
}
}