New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

draftjs-md-converter

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draftjs-md-converter - npm Package Compare versions

Comparing version

to
1.3.0

7

dist/index.js

@@ -282,3 +282,8 @@ 'use strict';

return children.reduce(function (prev, current) {
return prev + (current.value ? current.value.length : 0);
if (current.value) {
return prev + current.value.length;
} else if (current.children && current.children.length) {
return prev + getRawLength(current.children);
}
return prev;
}, 0);

@@ -285,0 +290,0 @@ };

2

package.json
{
"name": "draftjs-md-converter",
"version": "1.2.0",
"version": "1.3.0",
"description": "Converter for converting Draft.js state into Markdown and vice versa",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -93,3 +93,10 @@ 'use strict';

const getRawLength = children =>
children.reduce((prev, current) => prev + (current.value ? current.value.length : 0), 0);
children.reduce((prev, current) => {
if (current.value) {
return prev + current.value.length;
} else if (current.children && current.children.length) {
return prev + getRawLength(current.children);
}
return prev;
}, 0);

@@ -96,0 +103,0 @@ const addLink = child => {

Sorry, the diff of this file is not supported yet