fix(core): update

This commit is contained in:
Philipp Kunz 2022-05-29 15:02:48 +02:00
parent 9a77b5722a
commit c9776fc683
5 changed files with 22 additions and 3 deletions

12
package-lock.json generated
View File

@ -11,6 +11,7 @@
"dependencies": {
"@happy-dom/global-registrator": "^4.1.0",
"@pushrocks/smartpromise": "^3.1.7",
"@types/strip-comments": "^2.0.1",
"lit": "^2.2.5"
},
"devDependencies": {
@ -1297,6 +1298,12 @@
"dev": true,
"license": "MIT"
},
"node_modules/@types/strip-comments": {
"version": "2.0.1",
"resolved": "https://verdaccio.lossless.one/@types%2fstrip-comments/-/strip-comments-2.0.1.tgz",
"integrity": "sha512-7xjBu+wvKSRHSmgZoRAfUBZMIupd7634b2+uI2qeBDUvfoX+VELjuWCzlL6CF40eG/TGKwU+pqoJfvcvs3fzKA==",
"license": "MIT"
},
"node_modules/@types/through2": {
"version": "2.0.36",
"resolved": "https://verdaccio.lossless.one/@types%2fthrough2/-/through2-2.0.36.tgz",
@ -7147,6 +7154,11 @@
"integrity": "sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps=",
"dev": true
},
"@types/strip-comments": {
"version": "2.0.1",
"resolved": "https://verdaccio.lossless.one/@types%2fstrip-comments/-/strip-comments-2.0.1.tgz",
"integrity": "sha512-7xjBu+wvKSRHSmgZoRAfUBZMIupd7634b2+uI2qeBDUvfoX+VELjuWCzlL6CF40eG/TGKwU+pqoJfvcvs3fzKA=="
},
"@types/through2": {
"version": "2.0.36",
"resolved": "https://verdaccio.lossless.one/@types%2fthrough2/-/through2-2.0.36.tgz",

View File

@ -22,6 +22,7 @@
"dependencies": {
"@happy-dom/global-registrator": "^4.1.0",
"@pushrocks/smartpromise": "^3.1.7",
"@types/strip-comments": "^2.0.1",
"lit": "^2.2.5"
},
"browserslist": [

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@pushrocks/smartntml',
version: '1.0.8',
version: '1.0.9',
description: 'lit-html for the backend'
}

View File

@ -36,9 +36,13 @@ export class Smartntml {
this.html = lit.html;
}
public async renderTemplateResult(templateResult: litTypes.TemplateResult) {
public async renderTemplateResult(templateResult: litTypes.TemplateResult, stripCommentsArg = true) {
const element = document.createElement('div');
this.render(templateResult, element);
return element.innerHTML;
let stringResult = element.innerHTML;
if (stripCommentsArg) {
stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
}
return stringResult;
}
}

View File

@ -8,3 +8,5 @@ import * as smartpromise from '@pushrocks/smartpromise';
export {
smartpromise
}
// third party scope