Socket
Socket
Sign inDemoInstall

lit-html

Package Overview
Dependencies
Maintainers
1
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.5 to 0.2.6

5

lib/lit-html.js

@@ -272,2 +272,7 @@ /**

// up any residual nodes from a previously longer iterable.
const range = document.createRange();
range.setStartBefore(itemPart.endNode);
range.setEndBefore(this.endNode);
range.deleteContents();
range.detach();
itemPart.endNode = this.endNode;

@@ -274,0 +279,0 @@ }

13

lib/test/lit-html_test.js

@@ -64,2 +64,13 @@ /**

});
test('updates when called multiple times with arrays', () => {
const container = document.createElement('div');
const ul = (list) => {
var items = list.map(item => html `<li>${item}</li>`);
return html `<ul>${items}</ul>`;
};
ul(['a', 'b', 'c']).renderTo(container);
assert.equal(container.innerHTML, '<ul><li>a</li><li>b</li><li>c</li></ul>');
ul(['x', 'y']).renderTo(container);
assert.equal(container.innerHTML, '<ul><li>x</li><li>y</li></ul>');
});
});

@@ -450,3 +461,3 @@ suite('TemplateResult', () => {

});
test('updates when called multiple times with arrays', () => {
test('updates when called multiple times with arrays 2', () => {
part.setValue([1, 2, 3]);

@@ -453,0 +464,0 @@ assert.equal(container.innerHTML, '123');

2

package.json
{
"name": "lit-html",
"version": "0.2.5",
"version": "0.2.6",
"description": "HTML template literals in JavaScript",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

@@ -260,3 +260,2 @@ /**

setValue(value: any): void {
let node: Node|undefined = undefined;

@@ -312,2 +311,7 @@ value = this._getValue(value);

// up any residual nodes from a previously longer iterable.
const range = document.createRange();
range.setStartBefore(itemPart.endNode);
range.setEndBefore(this.endNode);
range.deleteContents();
range.detach();
itemPart.endNode = this.endNode;

@@ -314,0 +318,0 @@ }

@@ -74,4 +74,16 @@ /**

assert.equal(instance._parts.length, 2);
})
});
test('updates when called multiple times with arrays', () => {
const container = document.createElement('div');
const ul = (list: string[]) => {
var items = list.map(item => html`<li>${item}</li>`);
return html`<ul>${items}</ul>`;
};
ul(['a', 'b', 'c']).renderTo(container);
assert.equal(container.innerHTML, '<ul><li>a</li><li>b</li><li>c</li></ul>');
ul(['x', 'y']).renderTo(container);
assert.equal(container.innerHTML, '<ul><li>x</li><li>y</li></ul>');
});
});

@@ -544,3 +556,3 @@

test('updates when called multiple times with arrays', () => {
test('updates when called multiple times with arrays 2', () => {
part.setValue([1, 2, 3]);

@@ -547,0 +559,0 @@ assert.equal(container.innerHTML, '123');

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc