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

min-documentx

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

min-documentx - npm Package Compare versions

Comparing version 2.19.0 to 2.20.0

8

package.json
{
"name": "min-documentx",
"version": "2.19.0",
"version": "2.20.0",
"description": "A minimal DOM implementation",
"keywords": [],
"author": "Raynos <raynos2@gmail.com>",
"repository": "git://github.com/Javey/min-document.git",
"repository": "git://github.com/Raynos/min-document.git",
"main": "index",
"homepage": "https://github.com/Javey/min-document",
"homepage": "https://github.com/Raynos/min-document",
"contributors": [

@@ -16,3 +16,3 @@ {

"bugs": {
"url": "https://github.com/Javey/min-document/issues",
"url": "https://github.com/Raynos/min-document/issues",
"email": "raynos2@gmail.com"

@@ -19,0 +19,0 @@ },

@@ -49,3 +49,6 @@ module.exports = serializeNode

if (key === "style" && (type === "string" && elem[key] || Object.keys(elem.style).length > 0)) {
if (key === "style" && (
(type === "object" && Object.keys(elem.style).length > 0) ||
(type === "string" && elem.style)
)) {
return true

@@ -55,3 +58,3 @@ }

return elem.hasOwnProperty(key) &&
(type === "string" || type === "boolean" || type === "number") &&
(type === "string" || (type === "boolean" && elem[key]) || type === "number") &&
key !== "nodeName" && key !== "className" && key !== "tagName" &&

@@ -125,11 +128,3 @@ key !== "textContent" && key !== "innerText" && key !== "namespaceURI" && key !== "innerHTML"

function escapeText(s) {
var str = '';
if (typeof(s) === 'string') {
str = s;
} else if (s) {
str = s.toString();
}
return str
return String(s)
.replace(/&/g, "&amp;")

@@ -136,0 +131,0 @@ .replace(/</g, "&lt;")

@@ -204,5 +204,7 @@ var test = require("tape")

div.setAttribute("data-number", 100)
div.setAttribute("data-zero", 0)
div.setAttribute("data-boolean", true)
div.setAttribute("data-false", false)
div.setAttribute("data-null", null)
assert.equal(div.toString(), '<div data-number="100" data-boolean="true" data-null=""></div>')
assert.equal(div.toString(), '<div data-number="100" data-zero="0" data-boolean="true" data-false="false" data-null="null"></div>')
cleanup()

@@ -212,2 +214,14 @@ assert.end()

test("can handle non string property values", function(assert) {
var div = document.createElement("div")
div.id = 100
div.title = 0
div.contentEditable = true
div.selected = false
div.className = null
assert.equal(div.toString(), '<div id="100" title="0" contentEditable="true"></div>')
cleanup()
assert.end()
})
test("can serialize textarea correctly", function(assert) {

@@ -214,0 +228,0 @@ var input = document.createElement("textarea")

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