Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
一个含有a标签的字符串,解析出元素,
let mockStr = `您的快件<a href="www.baidu.com" target="_blank" >zjs2u38u28347</a>已经发出,
如果需要查询,请访问我们的<a href="www.sina.com" target="_blank" >网站</a>或微信咨询,或官方渠道`;
const { extractA } = require('extract-a');
let nodesArray = extractA(mockStr);
console.log(nodesArray);
// npm run test
输入=>
您的快件<a href="www.baidu.com" target="_blank" >zjs2u38u28347</a>已经发出,
如果需要查询,请访问我们的<a href="www.sina.com" target="_blank" >网站</a>或微信咨询,或官方渠道
输出=>
[ { type: 'text', content: '您的快件' },
{ type: 'link', content: 'zjs2u38u28347', href: 'www.baidu.com' },
{ type: 'text', content: '已经发出,\n如果需求查询,请访问我们的' },
{ type: 'link', content: '网站', href: 'www.sina.com' },
{ type: 'text', content: '或微信咨询,或官方聚到' } ]
FAQs
extract a element from a string
We found that extract-a demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.