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

textlint-rule-max-comma

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textlint-rule-max-comma - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

10

lib/textlint-rule-max-comma.js

@@ -9,3 +9,2 @@ // LICENSE : MIT

var filter = require("unist-util-filter");
var StringSource = require("textlint-util-to-string");
function countOfComma(text) {

@@ -31,4 +30,9 @@ return text.split(",").length - 1;

});
var source = new StringSource(nodeWithoutCode);
var text = source.toString();
if (!nodeWithoutCode) {
return;
}
var texts = Array.isArray(nodeWithoutCode.children) ? nodeWithoutCode.children.map(function (child) {
return getSource(child);
}) : [];
var text = texts.join("");
var sentences = (0, _sentenceSplitter.split)(text).filter(function (node) {

@@ -35,0 +39,0 @@ return node.type === _sentenceSplitter.Syntax.Sentence;

{
"name": "textlint-rule-max-comma",
"version": "1.0.3",
"version": "1.0.4",
"description": "textlint rule that limit maxinum comma(,) count of sentence.",

@@ -42,5 +42,4 @@ "main": "lib/textlint-rule-max-comma.js",

"sentence-splitter": "^2.0.0",
"textlint-util-to-string": "^2.0.0",
"unist-util-filter": "^0.2.1"
}
}

@@ -5,3 +5,2 @@ // LICENSE : MIT

const filter = require("unist-util-filter");
const StringSource = require("textlint-util-to-string");
function countOfComma(text) {

@@ -22,4 +21,9 @@ return text.split(",").length - 1;

});
const source = new StringSource(nodeWithoutCode);
const text = source.toString();
if (!nodeWithoutCode) {
return;
}
const texts = Array.isArray(nodeWithoutCode.children) ? nodeWithoutCode.children.map(child => {
return getSource(child);
}) : [];
const text = texts.join("");
const sentences = split(text).filter(node => node.type === SentenceSyntax.Sentence);

@@ -26,0 +30,0 @@ sentences.forEach(sentence => {

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