Buckets:
| import { noChange } from '../lit-html.js'; | |
| import { directive, Directive, PartType } from '../directive.js'; | |
| /** | |
| * @license | |
| * Copyright 2020 Google LLC | |
| * SPDX-License-Identifier: BSD-3-Clause | |
| */ | |
| 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. | |
| */ | |
| const templateContent = directive(TemplateContentDirective); | |
| export { templateContent }; | |
| //# sourceMappingURL=template-content.js.map | |
Xet Storage Details
- Size:
- 1.07 kB
- Xet hash:
- d72fd94f091ddd04afd39d064bd1606da861eaf000d49e56516e8672e4594835
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.