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

@wordpress/wordcount

Package Overview
Dependencies
Maintainers
8
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 2.0.2 to 2.0.3

5

build-module/index.js

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

export function count(text, type, userSettings) {
var settings = loadSettings(type, userSettings);
if ('' === text) {
return 0;
}
if (text) {
var settings = loadSettings(type, userSettings);
var matchRegExp = settings[type + 'RegExp'];

@@ -86,0 +89,0 @@ var results = 'words' === settings.type ? matchWords(text, matchRegExp, settings) : matchCharacters(text, matchRegExp, settings);

@@ -100,5 +100,8 @@ "use strict";

function count(text, type, userSettings) {
var settings = loadSettings(type, userSettings);
if ('' === text) {
return 0;
}
if (text) {
var settings = loadSettings(type, userSettings);
var matchRegExp = settings[type + 'RegExp'];

@@ -105,0 +108,0 @@ var results = 'words' === settings.type ? matchWords(text, matchRegExp, settings) : matchCharacters(text, matchRegExp, settings);

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

## 2.0.3 (2018-10-29)
### Polish
- Fix: `count` returns 0 for empty strings ([#10602](https://github.com/WordPress/gutenberg/pull/10602))
## 2.0.0 (2018-09-05)

@@ -2,0 +8,0 @@

4

package.json
{
"name": "@wordpress/wordcount",
"version": "2.0.2",
"version": "2.0.3",
"description": "WordPress word count utility.",

@@ -28,3 +28,3 @@ "author": "The WordPress Contributors",

},
"gitHead": "0aa5c4340f57a69ab935f9e819d74958aad2e022"
"gitHead": "308f6aa950705531ef9d360dc88bb9f4194542f5"
}

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

export function count( text, type, userSettings ) {
const settings = loadSettings( type, userSettings );
if ( '' === text ) {
return 0;
}
if ( text ) {
const settings = loadSettings( type, userSettings );
const matchRegExp = settings[ type + 'RegExp' ];

@@ -99,0 +103,0 @@ const results = ( 'words' === settings.type ) ?

@@ -88,3 +88,3 @@ /**

{
message: 'Empty Tags',
message: 'Empty tags',
string: '<p></p>',

@@ -95,2 +95,9 @@ words: 0,

},
{
message: 'Empty string',
string: '',
words: 0,
characters_excluding_spaces: 0,
characters_including_spaces: 0,
},
];

@@ -97,0 +104,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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