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

textlint-rule-terminology

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

textlint-rule-terminology - npm Package Compare versions

Comparing version 1.1.24 to 1.1.25

19

index.js
const fs = require('fs');
const path = require('path');
const stripJsonComments = require('strip-json-comments');

@@ -68,3 +69,2 @@ const { RuleHelper } = require('textlint-rule-helper');

const extras = typeof terms === 'string' ? loadJson(terms) : terms;
return defaults.concat(extras);

@@ -74,6 +74,20 @@ }

function loadJson(filepath) {
const json = fs.readFileSync(require.resolve(filepath), 'utf8');
const json = readTermsFile(path.resolve(filepath));
return JSON.parse(stripJsonComments(json));
}
function readTermsFile(filepath) {
try {
return fs.readFileSync(filepath, 'utf8');
}
catch (err) {
if (err.code === 'ENOENT') {
throw new Error(`Terms file not found: ${filepath}`);
}
else {
throw err;
}
}
}
function getRegExp(variants) {

@@ -100,2 +114,3 @@ return new RegExp(`(?:^|[^-\\w])((?:${variants.join('|')})(?= |\\. |\\.$|$))`, 'ig');

test: {
getTerms,
getRegExp,

@@ -102,0 +117,0 @@ getExactMatchRegExps,

6

package.json
{
"name": "textlint-rule-terminology",
"version": "1.1.24",
"version": "1.1.25",
"description": "TextLint rule to check correct terms spelling",

@@ -24,3 +24,2 @@ "author": {

"lint": "eslint . --fix",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"test:jest": "jest",

@@ -43,3 +42,2 @@ "test:watch": "jest --watch",

"jest": "^21.0.1",
"semantic-release": "^6.3.2",
"semantic-release-tamia": "^1.1.1",

@@ -58,2 +56,2 @@ "textlint-tester": "^2.2.4"

}
}
}
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