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

simple-dom

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-dom - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

47

dist/simple-dom-test.js

@@ -419,2 +419,6 @@ (function() {

buffer += this.serialize(next);
while(next = next.nextSibling) {
buffer += this.serialize(next);
}
}

@@ -426,7 +430,2 @@

next = node.nextSibling;
if (next) {
buffer += this.serialize(next);
}
return buffer;

@@ -1279,13 +1278,43 @@ };

QUnit.test('serializes correctly', function (assert) {
QUnit.test('serializes single element correctly', function (assert) {
var actual = this.serializer.serialize($$support$$element('div'));
assert.equal(actual, '<div></div>');
});
QUnit.test('serializes single void element correctly', function (assert) {
var actual = this.serializer.serialize($$support$$element('img', { src: 'foo' }));
assert.equal(actual, '<img src="foo">');
});
QUnit.test('serializes complex tree correctly', function (assert) {
var actual = this.serializer.serialize($$support$$fragment(
$$support$$element('div', { id:'foo' },
$$support$$element('div', { id: 'foo' },
$$support$$element('b', {},
$$support$$text('Foo & Bar')
)
),
$$support$$text('!'),
$$support$$element('img', { src: 'foo' })
)
));
assert.equal(actual, '<div id="foo"><b>Foo &amp; Bar</b></div>');
assert.equal(actual, '<div id="foo"><b>Foo &amp; Bar</b>!<img src="foo"></div>');
});
QUnit.test('does not serialize siblings of an element', function (assert) {
var html = $$support$$element('html');
var head = $$support$$element('head');
var body = $$support$$element('body');
head.appendChild($$support$$element('meta', { content: 'foo' }));
head.appendChild($$support$$element('meta', { content: 'bar' }));
html.appendChild(head);
html.appendChild(body);
var actual = this.serializer.serialize(head);
assert.equal(actual, '<head><meta content="foo"><meta content="bar"></head>');
actual = this.serializer.serialize(body);
assert.equal(actual, '<body></body>');
});
// SimpleDOM supports an extension of the DOM API that allows inserting strings of

@@ -1292,0 +1321,0 @@ // unparsed, raw HTML into the document. When the document is subsequently serialized,

9

dist/simple-dom.js

@@ -485,2 +485,6 @@ (function() {

buffer += this.serialize(next);
while(next = next.nextSibling) {
buffer += this.serialize(next);
}
}

@@ -492,7 +496,2 @@

next = node.nextSibling;
if (next) {
buffer += this.serialize(next);
}
return buffer;

@@ -499,0 +498,0 @@ };

@@ -96,2 +96,6 @@ function HTMLSerializer(voidMap) {

buffer += this.serialize(next);
while(next = next.nextSibling) {
buffer += this.serialize(next);
}
}

@@ -103,7 +107,2 @@

next = node.nextSibling;
if (next) {
buffer += this.serialize(next);
}
return buffer;

@@ -110,0 +109,0 @@ };

{
"name": "simple-dom",
"version": "0.2.4",
"version": "0.2.5",
"description": "A simple JS DOM.",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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