@aaronshaf/html-router
Advanced tools
Comparing version 1.0.4 to 1.0.5
17
index.js
@@ -5,2 +5,5 @@ import pathToRegexp from "./vendor/path-to-regexp/index.js"; | ||
const isCustomElement = node => | ||
node.tagName != null && node.tagName.includes("-"); | ||
const isRouteNode = node => node.hasAttribute("data-path"); | ||
@@ -35,11 +38,9 @@ | ||
if (match && matchFound === false) { | ||
if (match != null && matchFound === false) { | ||
matchFound = true; | ||
await Promise.all( | ||
Array.from(node.childNodes) | ||
.filter(isElement) | ||
.filter(isCustomElement) | ||
.map(async node => { | ||
if (node.tagName.includes("-")) { | ||
await customElements.whenDefined(node.tagName.toLowerCase()); | ||
} | ||
await customElements.whenDefined(node.tagName.toLowerCase()); | ||
node.match = { | ||
@@ -84,7 +85,5 @@ url: pathname, | ||
Array.from(this.childNodes) | ||
.filter(isElement) | ||
.filter(isCustomElement) | ||
.map(async node => { | ||
if (node.tagName.includes("-")) { | ||
await customElements.whenDefined(node.tagName.toLowerCase()); | ||
} | ||
await customElements.whenDefined(node.tagName.toLowerCase()); | ||
node.match = { | ||
@@ -91,0 +90,0 @@ url: pathname, |
@@ -10,3 +10,3 @@ { | ||
], | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"main": "index.js", | ||
@@ -13,0 +13,0 @@ "repository": { |
21174
580