diff --git a/package-lock.json b/package-lock.json index 2e17a6f..2895881 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3565,12 +3565,14 @@ "balanced-match": { "version": "1.0.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, "dev": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3585,17 +3587,20 @@ "code-point-at": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "concat-map": { "version": "0.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -3712,7 +3717,8 @@ "inherits": { "version": "2.0.3", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -3724,6 +3730,7 @@ "version": "1.0.0", "bundled": true, "dev": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -3738,6 +3745,7 @@ "version": "3.0.4", "bundled": true, "dev": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -3745,12 +3753,14 @@ "minimist": { "version": "0.0.8", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, "dev": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -3769,6 +3779,7 @@ "version": "0.5.1", "bundled": true, "dev": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -3849,7 +3860,8 @@ "number-is-nan": { "version": "1.0.1", "bundled": true, - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3861,6 +3873,7 @@ "version": "1.4.0", "bundled": true, "dev": true, + "optional": true, "requires": { "wrappy": "1" } @@ -3982,6 +3995,7 @@ "version": "1.0.2", "bundled": true, "dev": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/packages/router/src/components.d.ts b/packages/router/src/components.d.ts index 0eec29d..dce882c 100644 --- a/packages/router/src/components.d.ts +++ b/packages/router/src/components.d.ts @@ -17,7 +17,6 @@ import { RouteViewOptions, } from './global/interfaces'; - export namespace Components { interface StencilAsyncContent { 'documentLocation'?: string; diff --git a/packages/router/src/components/switch/switch.tsx b/packages/router/src/components/switch/switch.tsx index 5ce0893..a2c1243 100644 --- a/packages/router/src/components/switch/switch.tsx +++ b/packages/router/src/components/switch/switch.tsx @@ -14,6 +14,7 @@ const getUniqueId = () => { } const getMatch = (pathname: string, url: any, exact: boolean) => { + url = (typeof url === "undefined") ? pathname : url; return matchPath(pathname, { path: url, exact: exact, diff --git a/packages/router/src/utils/match-path.ts b/packages/router/src/utils/match-path.ts index 5371f46..cc4aa5c 100644 --- a/packages/router/src/utils/match-path.ts +++ b/packages/router/src/utils/match-path.ts @@ -48,7 +48,6 @@ export const matchPath = (pathname: string, options: MatchOptions = {}): null | if (!match) { return null; } - const [ url, ...values ] = match; const isExact = pathname === url;