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

chai-html

Package Overview
Dependencies
Maintainers
0
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-html - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

eslint.config.js

10

changelog.md
# Changelog
## v3.1.0
- Fix to normalize whitespace within text nodes
## v3.0.0
- Updates Chai peer dependency to v5
- Refactors package from CommonJS to ESM
## v2.1.0

@@ -11,2 +20,3 @@

- Fix for incorrect Node version reported in readme
## v2.0.0

@@ -13,0 +23,0 @@

14

lib/normalize.js

@@ -35,8 +35,12 @@ function attributes(attrs) {

// <https://www.w3.org/TR/html4/appendix/notes.html#notes-line-breaks>
if (node.nodeName === '#text' && i === 0) {
node.value = node.value.replace(/^\s+/, '')
}
if (node.nodeName === '#text') {
node.value = node.value.replace(/\s+/g, ' ')
if (node.nodeName === '#text' && i === last) {
node.value = node.value.replace(/\s+$/, '')
if (i === 0) {
node.value = node.value.replace(/^\s+/, '')
}
if (i === last) {
node.value = node.value.replace(/\s+$/, '')
}
}

@@ -43,0 +47,0 @@ })

{
"name": "chai-html",
"version": "3.0.0",
"version": "3.1.0",
"description": "HTML assertions for Chai.",

@@ -17,4 +17,4 @@ "keywords": [

"spec": "node --test --test-reporter spec",
"lint": "eslint . --ext js",
"format": "prettier --write '**/*.{js,jsx,json,yml}'",
"lint": "eslint",
"format": "prettier $([ $CI ] && echo '--check' || echo '--write') '**/*.{js,jsx,json,yml}'",
"verify": "npm run lint && npm run format",

@@ -36,8 +36,8 @@ "prepublishOnly": "npm run test"

"deep-diff": "^1.0.2",
"parse5": "^7.1.2"
"parse5": "^7.2.0"
},
"devDependencies": {
"chai": "^5.0.2",
"eslint": "^8.56.0",
"prettier": "^3.2.4"
"chai": "^5.1.2",
"eslint": "^9.20.0",
"prettier": "^3.5.0"
},

@@ -44,0 +44,0 @@ "peerDependencies": {

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