fix(core): Updated dependencies and optimized code structure
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* autocreated commitinfo by @pushrocks/commitinfo
|
||||
* autocreated commitinfo by @push.rocks/commitinfo
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartntml',
|
||||
version: '2.0.7',
|
||||
version: '2.0.8',
|
||||
description: 'Provides lit-html rendering capabilities for backend applications.'
|
||||
}
|
||||
|
17
ts/classes.smartntml.ts
Normal file
17
ts/classes.smartntml.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import * as plugins from './smartntml.plugins.js';
|
||||
export class Smartntml {
|
||||
constructor() {}
|
||||
|
||||
public async renderTemplateResult(
|
||||
templateResult: plugins.deesElement.TemplateResult,
|
||||
stripCommentsArg = true
|
||||
) {
|
||||
const element = document.createElement('div');
|
||||
plugins.deesElement.render(templateResult, element);
|
||||
let stringResult = element.innerHTML;
|
||||
if (stripCommentsArg) {
|
||||
stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
|
||||
}
|
||||
return stringResult;
|
||||
}
|
||||
}
|
21
ts/index.ts
21
ts/index.ts
@ -1,23 +1,8 @@
|
||||
// @ts-ignore
|
||||
import './instrument/happydom.js';
|
||||
|
||||
import * as plugins from './smartntml.plugins.js';
|
||||
|
||||
import { Smartntml } from './classes.smartntml.js';
|
||||
export { Smartntml };
|
||||
import * as deesElement from '@design.estate/dees-element';
|
||||
export { deesElement };
|
||||
|
||||
export class Smartntml {
|
||||
constructor() {}
|
||||
|
||||
public async renderTemplateResult(
|
||||
templateResult: plugins.deesElement.TemplateResult,
|
||||
stripCommentsArg = true
|
||||
) {
|
||||
const element = document.createElement('div');
|
||||
plugins.deesElement.render(templateResult, element);
|
||||
let stringResult = element.innerHTML;
|
||||
if (stripCommentsArg) {
|
||||
stringResult = stringResult.replace(/<!--(.*?)-->/g, '');
|
||||
}
|
||||
return stringResult;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
// first lets setup indexeddb
|
||||
import 'fake-indexeddb/auto';
|
||||
|
||||
// @ts-nocheck
|
||||
import { GlobalRegistrator } from '@happy-dom/global-registrator';
|
||||
GlobalRegistrator.register();
|
||||
window.location.href = 'http://localhost';
|
||||
|
Reference in New Issue
Block a user