helium-html
Advanced tools
Comparing version 0.2.0 to 0.3.0
import type { Value } from './Child.type'; | ||
import type { Namespace } from './Namespace.type'; | ||
import type { Template } from './Template.type'; | ||
export declare function svg(literal: TemplateStringsArray, ...parts: Value[]): DocumentFragment | Element; | ||
export declare function html(literal: TemplateStringsArray, ...parts: Value[]): DocumentFragment | Element; | ||
export declare function helium(literal: TemplateStringsArray, parts: Value[], namespace: Namespace): DocumentFragment | Element; | ||
export declare function parse_template(literal: TemplateStringsArray): Template; | ||
//# sourceMappingURL=html.d.ts.map |
@@ -11,22 +11,24 @@ 'use strict'; | ||
function svg(literal, ...parts) { | ||
return helium(literal, parts, Namespace_constants.SVG_NAMESPACE); | ||
const template = parse_template(literal); | ||
return render.render_template(template, parts, Namespace_constants.SVG_NAMESPACE); | ||
} | ||
function html(literal, ...parts) { | ||
return helium(literal, parts, Namespace_constants.HTML_NAMESPACE); | ||
const template = parse_template(literal); | ||
return render.render_template(template, parts, Namespace_constants.HTML_NAMESPACE); | ||
} | ||
function helium(literal, parts, namespace) { | ||
let template = template_cache.get(literal); | ||
if (!template) { | ||
const ctx = parser.create_parser(); | ||
const l = parts.length; | ||
for (const [i, chunk] of literal.raw.entries()) { | ||
parser.parse_chunk(ctx, chunk, i < l ? i : -1); | ||
} | ||
template = parser.close_parser(ctx); | ||
function parse_template(literal) { | ||
const template = template_cache.get(literal); | ||
if (template) { | ||
return template; | ||
} | ||
return render.render_template(template, parts, namespace); | ||
const ctx = parser.create_parser(); | ||
const l = literal.length - 1; | ||
for (const [i, chunk] of literal.raw.entries()) { | ||
parser.parse_chunk(ctx, chunk, i < l ? i : -1); | ||
} | ||
return parser.close_parser(ctx); | ||
} | ||
exports.helium = helium; | ||
exports.html = html; | ||
exports.parse_template = parse_template; | ||
exports.svg = svg; |
export { html, svg } from './html'; | ||
export { children } from './children'; | ||
export { distinct } from './operators'; | ||
export { route, redirect, router, navigate, link } from './router'; | ||
export { Store, Emitter, AbstractObservable } from './Observable'; | ||
@@ -5,0 +6,0 @@ export type { Observable, Disposable, Listener, Subscriber, Operator } from './Observable.type'; |
@@ -8,2 +8,3 @@ 'use strict'; | ||
var operators = require('./operators.js'); | ||
var router = require('./router.js'); | ||
var Observable = require('./Observable.js'); | ||
@@ -17,4 +18,9 @@ | ||
exports.distinct = operators.distinct; | ||
exports.link = router.link; | ||
exports.navigate = router.navigate; | ||
exports.redirect = router.redirect; | ||
exports.route = router.route; | ||
exports.router = router.router; | ||
exports.AbstractObservable = Observable.AbstractObservable; | ||
exports.Emitter = Observable.Emitter; | ||
exports.Store = Observable.Store; |
import type { Value } from './Child.type'; | ||
import type { Namespace } from './Namespace.type'; | ||
import type { Template } from './Template.type'; | ||
export declare function svg(literal: TemplateStringsArray, ...parts: Value[]): DocumentFragment | Element; | ||
export declare function html(literal: TemplateStringsArray, ...parts: Value[]): DocumentFragment | Element; | ||
export declare function helium(literal: TemplateStringsArray, parts: Value[], namespace: Namespace): DocumentFragment | Element; | ||
export declare function parse_template(literal: TemplateStringsArray): Template; | ||
//# sourceMappingURL=html.d.ts.map |
export { html, svg } from './html'; | ||
export { children } from './children'; | ||
export { distinct } from './operators'; | ||
export { route, redirect, router, navigate, link } from './router'; | ||
export { Store, Emitter, AbstractObservable } from './Observable'; | ||
@@ -5,0 +6,0 @@ export type { Observable, Disposable, Listener, Subscriber, Operator } from './Observable.type'; |
{ | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"name": "helium-html", | ||
@@ -24,7 +24,8 @@ "main": "cjs/index.js", | ||
"ts-jest": "^27.0.7", | ||
"typescript": "^4.6.3" | ||
"typescript": "^4.7.2" | ||
}, | ||
"dependencies": { | ||
"path-to-regexp": "^6.2.1", | ||
"ts-runtime-typecheck": "^2.6.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98355
102
1681
2
+ Addedpath-to-regexp@^6.2.1
+ Addedpath-to-regexp@6.3.0(transitive)