Buckets:

imerfanrajabee's picture
download
raw
1.04 kB
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/
import { noChange } from '../lit-html.js';
import { directive, Directive, PartType } from '../directive.js';
class TemplateContentDirective extends Directive {
constructor(partInfo) {
super(partInfo);
if (partInfo.type !== PartType.CHILD) {
throw new Error('templateContent can only be used in child bindings');
}
}
render(template) {
if (this._previousTemplate === template) {
return noChange;
}
this._previousTemplate = template;
return document.importNode(template.content, true);
}
}
/**
* Renders the content of a template element as HTML.
*
* Note, the template should be developer controlled and not user controlled.
* Rendering a user-controlled template with this directive
* could lead to cross-site-scripting vulnerabilities.
*/
export const templateContent = directive(TemplateContentDirective);
//# sourceMappingURL=template-content.js.map

Xet Storage Details

Size:
1.04 kB
·
Xet hash:
df35308bf098244240f92219c8545536c2b4c1dc3630d3f7bebb107c9e145324

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.