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.21 to 1.0.0-alpha.22

tests/Pragma/__snapshots__/jsfmt.spec.js.snap

3

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

@@ -71,2 +71,3 @@ "main": "src",

"prettier": "^1.15.3",
"semver": "^5.6.0",
"solidity-parser-antlr": "^0.4.0",

@@ -73,0 +74,0 @@ "string-width": "^3.0.0"

@@ -7,6 +7,19 @@ const {

const semver = require('semver');
const PragmaDirective = {
print: ({ node }) => concat(['pragma ', node.name, ' ', node.value, ';'])
print: ({ node }) => {
// @TODO: remove hack once solidity-parser-antlr is fixed
let value = node.value
.replace(/([<>=])/g, ' $1')
.replace(/< =/g, '<=')
.replace(/> =/g, '>=')
.trim();
if (value.split(' ').length > 1) {
value = semver.validRange(value);
}
return concat(['pragma ', node.name, ' ', value, ';']);
}
};
module.exports = PragmaDirective;
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