Socket
Socket
Sign inDemoInstall

@secretlint/messages-to-markdown

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@secretlint/messages-to-markdown - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

18

CHANGELOG.md

@@ -6,2 +6,20 @@ # Change Log

# [2.0.0](https://github.com/secretlint/secretlint/compare/v1.1.0...v2.0.0) (2020-04-27)
### Bug Fixes
* **core:** change SecretLintRuleMessageTranslate to check statically ([03ccff1](https://github.com/secretlint/secretlint/commit/03ccff116390374193ca5975405b0cafeaf63932))
### BREAKING CHANGES
* **core:** It changes SecretLintRuleMessageTranslate interface
Rule need to change `messages` object format.
# [1.1.0](https://github.com/secretlint/secretlint/compare/v1.0.5...v1.1.0) (2020-04-04)

@@ -8,0 +26,0 @@

7

lib/index.js

@@ -5,5 +5,10 @@ "use strict";

var output = "";
var proxy = new Proxy({}, {
get: function (_target, p, _receiver) {
return "{{" + String(p) + "}";
}
});
Object.keys(messages).forEach(function (messageId) {
var enMessage = messages[messageId]["en"];
var shortDescription = enMessage.split("\n")[0];
var shortDescription = enMessage(proxy).split("\n")[0];
output += "#".repeat(options.headerLevel) + " " + messageId + "\n" + (shortDescription ? "> " + shortDescription : "") + "\n\n";

@@ -10,0 +15,0 @@ });

6

package.json
{
"name": "@secretlint/messages-to-markdown",
"version": "1.1.0",
"version": "2.0.0",
"description": "Create Markdown text from rule's messages(ids)",

@@ -46,3 +46,3 @@ "keywords": [

"dependencies": {
"@secretlint/types": "^1.1.0",
"@secretlint/types": "^2.0.0",
"meow": "^6.1.0",

@@ -64,3 +64,3 @@ "ts-node": "^8.8.1",

},
"gitHead": "d924bd2e020439f449aa24d1673a3d212ebefa49"
"gitHead": "d961f968a46561ca424d54d6f34ce94e245a6e16"
}

@@ -8,5 +8,10 @@ import { SecretLintRuleLocalizeMessageMulti, SecretLintRuleLocalizeMessages } from "@secretlint/types";

let output = "";
const proxy = new Proxy({}, {
get(_target: {}, p: PropertyKey, _receiver: any): any {
return `{{${String(p)}}`;
}
});
Object.keys(messages).forEach(messageId => {
const enMessage = (messages[messageId] as SecretLintRuleLocalizeMessageMulti)["en"];
const shortDescription = enMessage.split("\n")[0];
const enMessage = (messages[messageId] as SecretLintRuleLocalizeMessageMulti<any>)["en"];
const shortDescription = enMessage(proxy).split("\n")[0];
output += `${"#".repeat(options.headerLevel)} ${messageId}

@@ -13,0 +18,0 @@ ${shortDescription ? `> ${shortDescription}` : ""}

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