Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

no-cliches

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

no-cliches - npm Package Compare versions

Comparing version 0.1.1 to 0.2.0

.eslintrc

10

cliches.js

@@ -1,2 +0,2 @@

var cliches = [
const cliches = [
'a chip off the old block',

@@ -701,7 +701,7 @@ 'a clean slate',

var clicheRegex = new RegExp('\\b(' + cliches.join('|') + ')\\b', 'gi');
var matcher = require("./matcher");
const clicheRegex = new RegExp(`\\b(${cliches.join('|')})\\b`, 'gi');
const matcher = require('./matcher');
module.exports = function (text) {
return matcher(clicheRegex, text, "clichés");
module.exports = function clichesMatcher(text) {
return matcher(clicheRegex, text);
};

@@ -1,11 +0,13 @@

var matcher = function(regex, text, type) {
var results = [];
function matcher(regex, text) {
const results = [];
let result = regex.exec(text);
while (result = regex.exec(text)) {
results.push({index: result.index, offset: result[0].length});
while (result) {
results.push({ index: result.index, offset: result[0].length });
result = regex.exec(text);
}
return results;
};
}
module.exports = matcher;
{
"name": "no-cliches",
"version": "0.1.1",
"version": "0.2.0",
"description": "Find clichés in your writings",
"main": "cliches.js",
"homepage": "https://github.com/duereg/no-cliches",
"author": "Matt Blair",
"author": {
"name": "Matt Blair",
"url": "blog.mattblair.co",
"email": ""
},
"engines": {
"node": ">=6",
"npm": ">=5"
},
"bugs": {

@@ -32,4 +40,9 @@ "url": "https://github.com/duereg/no-cliches/issues"

"devDependencies": {
"jasmine-node": "^2.0.1"
"jasmine-node": "^2.0.1",
"eslint": "^5.12.0",
"eslint-config-airbnb": "^17.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.12.3"
}
}

@@ -1,22 +0,22 @@

var cliches = require('../cliches');
var clichesInSentence = 'Writing specs puts me at loose ends.';
var goodSentence = 'The good dog jumps over the bad cat.';
const cliches = require('../cliches');
describe('no-cliches', function () {
const clichesInSentence = 'Writing specs puts me at loose ends.';
const goodSentence = 'The good dog jumps over the bad cat.';
describe('a sentence filled with cliches', function() {
var results = null;
describe('no-cliches', () => {
describe('a sentence filled with cliches', () => {
let results = null;
beforeEach(function() {
beforeEach(() => {
results = cliches(clichesInSentence);
});
it('will not escape notice', function () {
expect(results).toEqual([{ index : 22, offset : 13 }]);
it('will not escape notice', () => {
expect(results).toEqual([{ index: 22, offset: 13 }]);
});
})
});
it('should not have a problem with a short sentence', function () {
it('should not have a problem with a short sentence', () => {
expect(cliches(goodSentence)).toEqual([]);
});
});

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