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

@huggingface/prettier-plugin-vertical-align

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@huggingface/prettier-plugin-vertical-align - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

19

dist/printer.js

@@ -28,6 +28,3 @@ import prettier from "prettier";

const keyLength = node[keyLengthSymbol];
const addedLength = keyLength -
(node.key.loc.end.column - node.key.loc.start.column) -
(node.optional ? 1 : 0) -
(node.computed ? 2 : 0);
const addedLength = keyLength - (node.key.loc.end.column - node.key.loc.start.column) - modifierLength(node);
// console.log("keyLength", keyLength);

@@ -86,6 +83,3 @@ switch (node.type) {

for (const property of group) {
keyLength = Math.max(keyLength, property.key.loc.end.column -
property.key.loc.start.column +
(property.optional ? 1 : 0) +
(property.computed ? 2 : 0));
keyLength = Math.max(keyLength, property.key.loc.end.column - property.key.loc.start.column + modifierLength(property));
}

@@ -134,2 +128,11 @@ for (const property of group) {

}
function modifierLength(node) {
return ((node.optional ? "?".length : 0) +
(node.computed ? "[]".length : 0) +
(node.static ? "static ".length : 0) +
(node.accessibility ? node.accessibility.length + 1 : 0) +
(node.override ? "override ".length : 0) +
(node.declare ? "declare ".length : 0) +
(node.readonly ? "readonly ".length : 0));
}
//# sourceMappingURL=printer.js.map
{
"name": "@huggingface/prettier-plugin-vertical-align",
"packageManager": "pnpm@9.11.0",
"version": "0.2.1",
"version": "0.2.2",
"description": "",

@@ -6,0 +6,0 @@ "scripts": {

@@ -39,7 +39,3 @@ import type { AstPath, Printer } from "prettier";

const keyLength = node[keyLengthSymbol];
const addedLength =
keyLength -
(node.key.loc.end.column - node.key.loc.start.column) -
(node.optional ? 1 : 0) -
(node.computed ? 2 : 0);
const addedLength = keyLength - (node.key.loc.end.column - node.key.loc.start.column) - modifierLength(node);

@@ -111,6 +107,3 @@ // console.log("keyLength", keyLength);

keyLength,
property.key.loc.end.column -
property.key.loc.start.column +
(property.optional ? 1 : 0) +
(property.computed ? 2 : 0),
property.key.loc.end.column - property.key.loc.start.column + modifierLength(property),
);

@@ -165,3 +158,3 @@ }

}
if (node.type === "TSPropertySignature" || node.type === "PropertyDefinition") {
if (node.type === "TSPropertySignature" || node.type === "PropertyDefinition") {
return "typeAnnotation";

@@ -171,1 +164,13 @@ }

}
function modifierLength(node: AstPath["node"]) {
return (
(node.optional ? "?".length : 0) +
(node.computed ? "[]".length : 0) +
(node.static ? "static ".length : 0) +
(node.accessibility ? node.accessibility.length + 1 : 0) +
(node.override ? "override ".length : 0) +
(node.declare ? "declare ".length : 0) +
(node.readonly ? "readonly ".length : 0)
);
}

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