File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,7 @@ type MountValue = string;
22type MountValuePrefix = string ;
33type MountSelector = string ;
44type MountSelectorTemplate = string [ ] ;
5- type BlockMount = Element & {
6- tagName : 'DIV' ;
5+ type BlockMount = HTMLDivElement & {
76 id : MountValue ;
87 dataset : {
98 mount : string ;
@@ -67,8 +66,8 @@ function isNode(x: unknown): x is Node {
6766 return typeof x === 'object' && x instanceof Node ;
6867}
6968
70- function isElement ( x : unknown ) : x is Element {
71- return isNode ( x ) && x . nodeType === Node . ELEMENT_NODE ;
69+ function isDiv ( x : unknown ) : x is HTMLDivElement {
70+ return isNode ( x ) && x instanceof HTMLElement && x . tagName === 'DIV' ;
7271}
7372
7473export function isMount (
@@ -77,12 +76,12 @@ export function isMount(
7776 exact : boolean = false
7877) : x is Mount {
7978 return (
80- isElement ( x ) &&
79+ isDiv ( x ) &&
8180 ( value === undefined
8281 ? x . matches ( MOUNT_SELECTOR )
8382 : exact
84- ? x . matches ( exactMountSelector ( value ) )
85- : x . matches ( prefixedMountSelector ( value ) ) )
83+ ? x . matches ( exactMountSelector ( value ) )
84+ : x . matches ( prefixedMountSelector ( value ) ) )
8685 ) ;
8786}
8887
You can’t perform that action at this time.
0 commit comments