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

eslint-plugin-zod-to-openapi

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-zod-to-openapi - npm Package Compare versions

Comparing version 0.0.23 to 0.0.24

24

lib-commonjs/rules/require-comment/rule.js

@@ -32,3 +32,5 @@ "use strict";

const deprecatedValue = deprecated ? `${DEPRECATED_TAG} ` : '';
const exampleValue = example ? `\n${EXAMPLE_TAG} ${example}` : '';
const exampleValue = example
? `\n${EXAMPLE_TAG} ${JSON.stringify(example)}`
: '';
return `${deprecatedValue}${contents}${exampleValue}`;

@@ -75,3 +77,3 @@ };

};
const getExampleValue = (properties, context) => {
const getExampleValue = (properties) => {
const examples = getPropertyNode(properties, 'examples');

@@ -84,10 +86,14 @@ const example = getPropertyNode(properties, 'example');

}
const element = examples.value.elements?.[0];
if (!element || element.type !== 'Literal') {
return;
}
// Because grabbing a value is difficult if it is not a literal
const arrayText = context.getSourceCode().getText(examples.value);
// Remove square brackets
return arrayText.slice(1, -1);
return element.value;
}
if (example) {
const text = context.getSourceCode().getText(example.value);
return text;
if (example.value.type !== 'Literal') {
return;
}
return example.value.value;
}

@@ -134,3 +140,3 @@ return undefined;

const deprecatedValue = Boolean(getLiteralValue(deprecatedNode));
const exampleValue = getExampleValue(argument.properties, context);
const exampleValue = getExampleValue(argument.properties);
return createCommentValue(descriptionValue, deprecatedValue, exampleValue);

@@ -198,3 +204,3 @@ };

}
const commentValue = commentRegex.exec(comment.value)?.[1];
const commentValue = getCommentValue(comment.value);
if (!commentValue || expectedCommentValue !== commentValue) {

@@ -201,0 +207,0 @@ return context.report({

{
"name": "eslint-plugin-zod-to-openapi",
"version": "0.0.23",
"version": "0.0.24",
"private": false,

@@ -5,0 +5,0 @@ "description": "Eslint rules for zod-to-openapi",

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