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

@wordpress/wordcount

Package Overview
Dependencies
Maintainers
6
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/wordcount - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

8

build-module/index.js

@@ -83,8 +83,6 @@ import { extend, flow } from 'lodash';

var matchRegExp = settings[type + 'RegExp'];
if ('words' === settings.type) {
return matchWords(text, matchRegExp, settings).length;
} else {
return matchCharacters(text, matchRegExp, settings).length;
}
var results = 'words' === settings.type ? matchWords(text, matchRegExp, settings) : matchCharacters(text, matchRegExp, settings);
return results ? results.length : 0;
}
}

@@ -120,8 +120,6 @@ 'use strict';

var matchRegExp = settings[type + 'RegExp'];
if ('words' === settings.type) {
return matchWords(text, matchRegExp, settings).length;
} else {
return matchCharacters(text, matchRegExp, settings).length;
}
var results = 'words' === settings.type ? matchWords(text, matchRegExp, settings) : matchCharacters(text, matchRegExp, settings);
return results ? results.length : 0;
}
}

@@ -1,7 +0,11 @@

## 1.0.1
## 1.0.2 (2018-05-08)
- Fix: Resolve error when input strings contains only whitespace ([#123](https://github.com/WordPress/packages/pull/123))
## 1.0.1 (2018-05-01)
- Internal: Include `publishConfig` configuration in `package.json`. ([#114](https://github.com/WordPress/packages/pull/114))
## 1.0.0
## 1.0.0 (2018-04-24)
- Initial release
{
"name": "@wordpress/wordcount",
"version": "1.0.1",
"version": "1.0.2",
"repository": {

@@ -5,0 +5,0 @@ "type": "git",

@@ -98,8 +98,8 @@ import { extend, flow } from 'lodash';

let matchRegExp = settings[ type + 'RegExp' ];
if ( 'words' === settings.type ) {
return matchWords( text, matchRegExp, settings ).length;
} else {
return matchCharacters( text, matchRegExp, settings ).length;
}
const results = ( 'words' === settings.type ) ?
matchWords( text, matchRegExp, settings ) :
matchCharacters( text, matchRegExp, settings );
return results ? results.length : 0;
}
}

@@ -87,2 +87,9 @@ /**

characters_including_spaces: 6
},
{
message: "Empty Tags",
string: "<p></p>",
words: 0,
characters_excluding_spaces: 0,
characters_including_spaces: 0
}

@@ -89,0 +96,0 @@ ];

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