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

prettier-plugin-java

Package Overview
Dependencies
Maintainers
6
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-java - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

2

dist/options.js

@@ -29,2 +29,4 @@ "use strict";

{ value: "switchLabel" },
{ value: "caseOrDefaultLabel" },
{ value: "caseLabelElement" },
{ value: "switchRule" },

@@ -31,0 +33,0 @@ { value: "caseConstant" },

34

dist/printers/blocks-and-statements.js

@@ -184,16 +184,22 @@ "use strict";

BlocksAndStatementPrettierVisitor.prototype.switchBlockStatementGroup = function (ctx) {
var switchLabels = this.mapVisit(ctx.switchLabel);
var labels = [];
for (var i = 0; i < switchLabels.length; i++) {
labels.push(prettier_builder_1.concat([switchLabels[i], ctx.Colon[i]]));
}
var switchLabel = this.visit(ctx.switchLabel);
var blockStatements = this.visit(ctx.blockStatements);
return prettier_builder_1.indent(printer_utils_1.rejectAndJoin(hardline, [
prettier_builder_1.dedent(printer_utils_1.rejectAndJoin(hardline, labels)),
blockStatements
]));
return prettier_builder_1.concat([
switchLabel,
ctx.Colon[0],
blockStatements && prettier_builder_1.indent([hardline, blockStatements])
]);
};
BlocksAndStatementPrettierVisitor.prototype.switchLabel = function (ctx) {
var caseOrDefaultLabels = this.mapVisit(ctx.caseOrDefaultLabel);
var colons = ctx.Colon
? ctx.Colon.map(function (elt) {
return prettier_builder_1.concat([elt, hardline]);
})
: [];
return prettier_builder_1.group(printer_utils_1.rejectAndJoinSeps(colons, caseOrDefaultLabels));
};
BlocksAndStatementPrettierVisitor.prototype.caseOrDefaultLabel = function (ctx) {
if (ctx.Case) {
var caseConstants = this.mapVisit(ctx.caseConstant);
var caseLabelElements = this.mapVisit(ctx.caseLabelElement);
var commas = ctx.Comma

@@ -206,3 +212,3 @@ ? ctx.Comma.map(function (elt) {

prettier_builder_1.concat([ctx.Case[0], " "]),
printer_utils_1.rejectAndJoinSeps(commas, caseConstants)
printer_utils_1.rejectAndJoinSeps(commas, caseLabelElements)
])));

@@ -212,2 +218,8 @@ }

};
BlocksAndStatementPrettierVisitor.prototype.caseLabelElement = function (ctx) {
if (ctx.Default || ctx.Null) {
return this.getSingle(ctx);
}
return this.visitSingle(ctx);
};
BlocksAndStatementPrettierVisitor.prototype.switchRule = function (ctx) {

@@ -214,0 +226,0 @@ var switchLabel = this.visit(ctx.switchLabel);

@@ -107,8 +107,8 @@ "use strict";

var typeParameterList = this.visit(ctx.typeParameterList);
return printer_utils_1.rejectAndConcat([ctx.Less[0], typeParameterList, ctx.Greater[0]]);
return printer_utils_1.putIntoBraces(typeParameterList, softline, ctx.Less[0], ctx.Greater[0]);
};
ClassesPrettierVisitor.prototype.typeParameterList = function (ctx) {
var typeParameter = this.mapVisit(ctx.typeParameter);
var commas = ctx.Comma ? ctx.Comma.map(function (elt) { return prettier_builder_1.concat([elt, " "]); }) : [];
return printer_utils_1.rejectAndJoinSeps(commas, typeParameter);
var commas = ctx.Comma ? ctx.Comma.map(function (elt) { return prettier_builder_1.concat([elt, line]); }) : [];
return prettier_builder_1.group(printer_utils_1.rejectAndJoinSeps(commas, typeParameter));
};

@@ -651,3 +651,3 @@ ClassesPrettierVisitor.prototype.superclass = function (ctx) {

var recordComponents = this.mapVisit(ctx.recordComponent);
var commas = ctx.Comma ? ctx.Comma.map(function (elt) { return prettier_builder_1.concat([elt, " "]); }) : [];
var commas = ctx.Comma ? ctx.Comma.map(function (elt) { return prettier_builder_1.concat([elt, line]); }) : [];
return printer_utils_1.rejectAndJoinSeps(commas, recordComponents);

@@ -654,0 +654,0 @@ };

{
"name": "prettier-plugin-java",
"version": "1.4.0",
"version": "1.5.0",
"description": "Prettier Java Plugin",

@@ -12,3 +12,3 @@ "main": "dist/index.js",

"dependencies": {
"java-parser": "1.4.0",
"java-parser": "2.0.0",
"lodash": "4.17.21",

@@ -46,3 +46,3 @@ "prettier": "2.3.1"

},
"gitHead": "ccc76f65f711ad5be7a7980077e1bfcb54d0571d"
"gitHead": "a9fe7da3d13d0c8a4b74dc6623f3b388fc2aade4"
}
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