@wordpress/wordcount
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -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 @@ ]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
30237
0