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

@wordpress/wordcount

Package Overview
Dependencies
Maintainers
25
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 3.34.0 to 3.35.0

12

build-module/index.js

@@ -35,6 +35,6 @@ /**

function loadSettings(type, userSettings) {
var _settings$l10n$shortc, _settings$l10n;
var _settings$l10n$shortc;
const settings = Object.assign({}, defaultSettings, userSettings);
settings.shortcodes = (_settings$l10n$shortc = (_settings$l10n = settings.l10n) === null || _settings$l10n === void 0 ? void 0 : _settings$l10n.shortcodes) !== null && _settings$l10n$shortc !== void 0 ? _settings$l10n$shortc : [];
settings.shortcodes = (_settings$l10n$shortc = settings.l10n?.shortcodes) !== null && _settings$l10n$shortc !== void 0 ? _settings$l10n$shortc : [];

@@ -65,7 +65,7 @@ if (settings.shortcodes && settings.shortcodes.length) {

function countWords(text, regex, settings) {
var _text$match$length, _text$match;
var _text$match$length;
text = [stripTags.bind(null, settings), stripHTMLComments.bind(null, settings), stripShortcodes.bind(null, settings), stripSpaces.bind(null, settings), stripHTMLEntities.bind(null, settings), stripConnectors.bind(null, settings), stripRemovables.bind(null, settings)].reduce((result, fn) => fn(result), text);
text = text + '\n';
return (_text$match$length = (_text$match = text.match(regex)) === null || _text$match === void 0 ? void 0 : _text$match.length) !== null && _text$match$length !== void 0 ? _text$match$length : 0;
return (_text$match$length = text.match(regex)?.length) !== null && _text$match$length !== void 0 ? _text$match$length : 0;
}

@@ -84,7 +84,7 @@ /**

function countCharacters(text, regex, settings) {
var _text$match$length2, _text$match2;
var _text$match$length2;
text = [stripTags.bind(null, settings), stripHTMLComments.bind(null, settings), stripShortcodes.bind(null, settings), transposeAstralsToCountableChar.bind(null, settings), stripSpaces.bind(null, settings), transposeHTMLEntitiesToCountableChars.bind(null, settings)].reduce((result, fn) => fn(result), text);
text = text + '\n';
return (_text$match$length2 = (_text$match2 = text.match(regex)) === null || _text$match2 === void 0 ? void 0 : _text$match2.length) !== null && _text$match$length2 !== void 0 ? _text$match$length2 : 0;
return (_text$match$length2 = text.match(regex)?.length) !== null && _text$match$length2 !== void 0 ? _text$match$length2 : 0;
}

@@ -91,0 +91,0 @@ /**

@@ -54,6 +54,6 @@ "use strict";

function loadSettings(type, userSettings) {
var _settings$l10n$shortc, _settings$l10n;
var _settings$l10n$shortc;
const settings = Object.assign({}, _defaultSettings.defaultSettings, userSettings);
settings.shortcodes = (_settings$l10n$shortc = (_settings$l10n = settings.l10n) === null || _settings$l10n === void 0 ? void 0 : _settings$l10n.shortcodes) !== null && _settings$l10n$shortc !== void 0 ? _settings$l10n$shortc : [];
settings.shortcodes = (_settings$l10n$shortc = settings.l10n?.shortcodes) !== null && _settings$l10n$shortc !== void 0 ? _settings$l10n$shortc : [];

@@ -84,7 +84,7 @@ if (settings.shortcodes && settings.shortcodes.length) {

function countWords(text, regex, settings) {
var _text$match$length, _text$match;
var _text$match$length;
text = [_stripTags.default.bind(null, settings), _stripHTMLComments.default.bind(null, settings), _stripShortcodes.default.bind(null, settings), _stripSpaces.default.bind(null, settings), _stripHTMLEntities.default.bind(null, settings), _stripConnectors.default.bind(null, settings), _stripRemovables.default.bind(null, settings)].reduce((result, fn) => fn(result), text);
text = text + '\n';
return (_text$match$length = (_text$match = text.match(regex)) === null || _text$match === void 0 ? void 0 : _text$match.length) !== null && _text$match$length !== void 0 ? _text$match$length : 0;
return (_text$match$length = text.match(regex)?.length) !== null && _text$match$length !== void 0 ? _text$match$length : 0;
}

@@ -103,7 +103,7 @@ /**

function countCharacters(text, regex, settings) {
var _text$match$length2, _text$match2;
var _text$match$length2;
text = [_stripTags.default.bind(null, settings), _stripHTMLComments.default.bind(null, settings), _stripShortcodes.default.bind(null, settings), _transposeAstralsToCountableChar.default.bind(null, settings), _stripSpaces.default.bind(null, settings), _transposeHTMLEntitiesToCountableChars.default.bind(null, settings)].reduce((result, fn) => fn(result), text);
text = text + '\n';
return (_text$match$length2 = (_text$match2 = text.match(regex)) === null || _text$match2 === void 0 ? void 0 : _text$match2.length) !== null && _text$match$length2 !== void 0 ? _text$match$length2 : 0;
return (_text$match$length2 = text.match(regex)?.length) !== null && _text$match$length2 !== void 0 ? _text$match$length2 : 0;
}

@@ -110,0 +110,0 @@ /**

@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## 3.35.0 (2023-06-07)
## 3.34.0 (2023-05-24)

@@ -7,0 +9,0 @@

{
"name": "@wordpress/wordcount",
"version": "3.34.0",
"version": "3.35.0",
"description": "WordPress word count utility.",

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

},
"gitHead": "c7c79cb11b677adcbf06cf5f8cfb6c5ec1699f19"
"gitHead": "a92f606309b1541b834ff9b0a76ed2a466fc45ed"
}

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