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

prettier-plugin-solidity

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prettier-plugin-solidity - npm Package Compare versions

Comparing version 1.0.0-alpha.23 to 1.0.0-alpha.24

NOTES.md

2

package.json
{
"name": "prettier-plugin-solidity",
"version": "1.0.0-alpha.23",
"version": "1.0.0-alpha.24",
"description": "prettier plugin for solidity",

@@ -5,0 +5,0 @@ "main": "src",

@@ -0,1 +1,2 @@

/* eslint-disable implicit-arrow-linebreak */
const {

@@ -7,43 +8,55 @@ doc: {

const FunctionCall = {
print: ({ node, path, print }) => {
let doc;
if (node.names && node.names.length > 0) {
doc = concat([
'{',
group(
concat([
indent(
concat([
softline,
join(
concat([',', line]),
path
.map(print, 'arguments')
.map((arg, index) => concat([node.names[index], ': ', arg]))
)
])
),
softline
])
),
'}'
]);
} else {
doc = group(
const printObject = (node, path, print) =>
group(
concat([
'{',
indent(
concat([
indent(
concat([
softline,
join(concat([',', line]), path.map(print, 'arguments'))
])
),
softline
softline,
join(
concat([',', line]),
path
.map(print, 'arguments')
.map((arg, index) => concat([node.names[index], ': ', arg]))
)
])
);
}
return concat([path.call(print, 'expression'), '(', doc, ')']);
),
softline,
'}'
])
);
const printParameters = (node, path, print) =>
group(
concat([
indent(
concat([
softline,
join(concat([',', line]), path.map(print, 'arguments'))
])
),
softline
])
);
const printArguments = (node, path, print) => {
if (node.names && node.names.length > 0) {
return printObject(node, path, print);
}
if (node.arguments && node.arguments.length > 0) {
return printParameters(node, path, print);
}
return '';
};
const FunctionCall = {
print: ({ node, path, print }) =>
concat([
path.call(print, 'expression'),
'(',
printArguments(node, path, print),
')'
])
};
module.exports = FunctionCall;

@@ -0,4 +1,5 @@

/* eslint-disable implicit-arrow-linebreak */
const {
doc: {
builders: { concat, join }
builders: { concat, group, indent, join, line, softline }
}

@@ -8,17 +9,22 @@ } = require('prettier');

const TupleExpression = {
print: ({ node, path, print }) => {
let doc;
// @TODO: remove hack once solidity-parser-antlr is fixed
if (node.components) {
doc = join(', ', path.map(print, 'components'));
} else {
doc = join(', ', path.map(print, 'elements'));
}
if (node.isArray) {
return concat(['[', doc, ']']);
}
return concat(['(', doc, ')']);
}
// @TODO: remove hack once solidity-parser-antlr is fixed
print: ({ node, path, print }) =>
group(
concat([
node.isArray ? '[' : '(',
indent(
concat([
softline,
join(
concat([',', line]),
path.map(print, node.components ? 'components' : 'elements')
)
])
),
softline,
node.isArray ? ']' : ')'
])
)
};
module.exports = TupleExpression;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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