Bump @types/url-parse from 1.4.4 to 1.4.5 (#4494)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
dependabot[bot]andSebastian Malton authored and GitHub committed 2021-12-03 08:59:18 -05:00
1 parent 29c9c73a13
commit 8055ba261b
5 files changed
+16 -16

No files matched your search

+2 -2
View File
@@ -30,13 +30,13 @@ export enum RoutingErrorType {
MISSING_EXTENSION = "missing-ext",
}
export class RoutingError extends Error {
export class RoutingError<Query> extends Error {
/**
* Will be set if the routing error originated in an extension route table
*/
public extensionName?: string;
constructor(public type: RoutingErrorType, public url: Url) {
constructor(public type: RoutingErrorType, public url: Url<Query>) {
super("routing error");
}
+5 -5
View File
@@ -91,7 +91,7 @@ export abstract class LensProtocolRouter extends Singleton {
* @param url the parsed URL that initiated the `lens://` protocol
* @returns true if a route has been found
*/
protected _routeToInternal(url: Url): RouteAttempt {
protected _routeToInternal(url: Url<Record<string, string>>): RouteAttempt {
return this._route(this.internalRoutes.entries(), url);
}
@@ -101,7 +101,7 @@ export abstract class LensProtocolRouter extends Singleton {
* @param routes the array of path schemas, handler pairs to match against
* @param url the url (in its current state)
*/
protected _findMatchingRoute(routes: Iterable<[string, RouteHandler]>, url: Url): null | [match<Record<string, string>>, RouteHandler] {
protected _findMatchingRoute(routes: Iterable<[string, RouteHandler]>, url: Url<Record<string, string>>): null | [match<Record<string, string>>, RouteHandler] {
const matches: [match<Record<string, string>>, RouteHandler][] = [];
for (const [schema, handler] of routes) {
@@ -128,7 +128,7 @@ export abstract class LensProtocolRouter extends Singleton {
* @param routes the array of (path schemas, handler) pairs to match against
* @param url the url (in its current state)
*/
protected _route(routes: Iterable<[string, RouteHandler]>, url: Url, extensionName?: string): RouteAttempt {
protected _route(routes: Iterable<[string, RouteHandler]>, url: Url<Record<string, string>>, extensionName?: string): RouteAttempt {
const route = this._findMatchingRoute(routes, url);
if (!route) {
@@ -166,7 +166,7 @@ export abstract class LensProtocolRouter extends Singleton {
* @param url the protocol request URI that was "open"-ed
* @returns either the found name or the instance of `LensExtension`
*/
protected async _findMatchingExtensionByName(url: Url): Promise<LensExtension | string> {
protected async _findMatchingExtensionByName(url: Url<Record<string, string>>): Promise<LensExtension | string> {
interface ExtensionUrlMatch {
[EXTENSION_PUBLISHER_MATCH]: string;
[EXTENSION_NAME_MATCH]: string;
@@ -222,7 +222,7 @@ export abstract class LensProtocolRouter extends Singleton {
* Note: this function modifies its argument, do not reuse
* @param url the protocol request URI that was "open"-ed
*/
protected async _routeToExtension(url: Url): Promise<RouteAttempt> {
protected async _routeToExtension(url: Url<Record<string, string>>): Promise<RouteAttempt> {
const extension = await this._findMatchingExtensionByName(url);
if (typeof extension === "string") {
+4 -4
View File
@@ -39,7 +39,7 @@ export interface FallbackHandler {
* @returns `true` if it should be routed internally to Lens, `false` if to an extension
* @throws if `host` is not valid
*/
function checkHost(url: URLParse): boolean {
function checkHost<Query>(url: URLParse<Query>): boolean {
switch (url.host) {
case "app":
return true;
@@ -112,7 +112,7 @@ export class LensProtocolRouterMain extends proto.LensProtocolRouter {
return false;
}
protected async _findMatchingExtensionByName(url: URLParse): Promise<LensExtension | string> {
protected async _findMatchingExtensionByName(url: URLParse<Record<string, string>>): Promise<LensExtension | string> {
const firstAttempt = await super._findMatchingExtensionByName(url);
if (typeof firstAttempt !== "string") {
@@ -126,7 +126,7 @@ export class LensProtocolRouterMain extends proto.LensProtocolRouter {
return "";
}
protected _routeToInternal(url: URLParse): RouteAttempt {
protected _routeToInternal(url: URLParse<Record<string, string>>): RouteAttempt {
const rawUrl = url.toString(); // for sending to renderer
const attempt = super._routeToInternal(url);
@@ -135,7 +135,7 @@ export class LensProtocolRouterMain extends proto.LensProtocolRouter {
return attempt;
}
protected async _routeToExtension(url: URLParse): Promise<RouteAttempt> {
protected async _routeToExtension(url: URLParse<Record<string, string>>): Promise<RouteAttempt> {
const rawUrl = url.toString(); // for sending to renderer
/**