typed-dom
Advanced tools
Comparing version 0.0.265 to 0.0.266
10
dom.ts
@@ -113,5 +113,11 @@ import { Symbol, document } from 'spica/global'; | ||
export function define<T extends Element | DocumentFragment | ShadowRoot>(node: T, attrs?: Attrs | Children, children?: Children): T { | ||
// Need the next type assertions to suppress an impossible type error on dependent projects. | ||
// Probably caused by typed-query-selector. | ||
// | ||
// typed-dom/dom.ts(113,3): Error TS2322: Type 'ParentNode & Node' is not assignable to type 'T'. | ||
// 'T' could be instantiated with an arbitrary type which could be unrelated to 'ParentNode & Node'. | ||
// | ||
return isChildren(attrs) | ||
? defineChildren(node, attrs) | ||
: defineChildren(defineAttrs(node as Element, attrs) as T, children); | ||
? defineChildren(node, attrs) as T | ||
: defineChildren(defineAttrs(node as Element, attrs), children) as T; | ||
} | ||
@@ -118,0 +124,0 @@ function defineAttrs<T extends Element>(el: T, attrs: Attrs): T { |
{ | ||
"name": "typed-dom", | ||
"version": "0.0.265", | ||
"version": "0.0.266", | ||
"description": "A value-level and type-level DOM builder.", | ||
@@ -5,0 +5,0 @@ "private": false, |
@@ -113,5 +113,11 @@ import { Symbol, document } from 'spica/global'; | ||
export function define<T extends Element | DocumentFragment | ShadowRoot>(node: T, attrs?: Attrs | Children, children?: Children): T { | ||
// Need the next type assertions to suppress an impossible type error on dependent projects. | ||
// Probably caused by typed-query-selector. | ||
// | ||
// typed-dom/dom.ts(113,3): Error TS2322: Type 'ParentNode & Node' is not assignable to type 'T'. | ||
// 'T' could be instantiated with an arbitrary type which could be unrelated to 'ParentNode & Node'. | ||
// | ||
return isChildren(attrs) | ||
? defineChildren(node, attrs) | ||
: defineChildren(defineAttrs(node as Element, attrs) as T, children); | ||
? defineChildren(node, attrs) as T | ||
: defineChildren(defineAttrs(node as Element, attrs), children) as T; | ||
} | ||
@@ -118,0 +124,0 @@ function defineAttrs<T extends Element>(el: T, attrs: Attrs): T { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
673798
15844