Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@20minutes/draft-convert
Advanced tools
Extensibly serialize & deserialize Draft.js ContentState
Forked version:
validateHTML
function parameter for convertToHTML
For the official readme, check the official project.
validateHTML
(option of convertToHTML
)validateHTML
take the final HTML of the current block as parameter and must return a boolean saying if every thing is ok.
We do have some custom entity/block generation and sometimes, the produced HTML might be wrong. So we validate it using ReactDomServer, like:
import ReactDOMServer from 'react-dom/server'
import { Parser as HtmlToReactParser } from 'html-to-react'
// ...
const html = convertToHTML({
// ...
validateHTML: (html) => {
try {
const htmlToReactParser = HtmlToReactParser()
ReactDOMServer.renderToString(htmlToReactParser.parse(html))
return true
} catch (e) {
return false
}
})(editorState.getCurrentContent());
FAQs
Extensibly serialize & deserialize Draft.js ContentState
The npm package @20minutes/draft-convert receives a total of 69 weekly downloads. As such, @20minutes/draft-convert popularity was classified as not popular.
We found that @20minutes/draft-convert demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.