1
0
mirror of https://github.com/lensapp/lens.git synced 2024-09-20 05:47:24 +03:00

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] 2021-12-03 08:59:18 -05:00 committed by GitHub
parent 29c9c73a13
commit 8055ba261b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 16 deletions

View File

@ -312,7 +312,7 @@
"@types/tcp-port-used": "^1.0.0",
"@types/tempy": "^0.3.0",
"@types/triple-beam": "^1.3.2",
"@types/url-parse": "^1.4.4",
"@types/url-parse": "^1.4.5",
"@types/uuid": "^8.3.3",
"@types/webpack": "^4.41.31",
"@types/webpack-dev-server": "^3.11.6",

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");
}

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") {

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
/**

View File

@ -1951,10 +1951,10 @@
resolved "https://registry.yarnpkg.com/@types/underscore/-/underscore-1.10.0.tgz#5cb0dff2a5f616fc8e0c61b482bf01fa20a03cec"
integrity sha512-ZAbqul7QAKpM2h1PFGa5ETN27ulmqtj0QviYHasw9LffvXZvVHuraOx/FOsIPPDNGZN0Qo1nASxxSfMYOtSoCw==
"@types/url-parse@^1.4.4":
version "1.4.4"
resolved "https://registry.yarnpkg.com/@types/url-parse/-/url-parse-1.4.4.tgz#ebeb0ec8b581318739cf73e9f9b186f610764255"
integrity sha512-KtQLad12+4T/NfSxpoDhmr22+fig3T7/08QCgmutYA6QSznSRmEtuL95GrhVV40/0otTEdFc+etRcCTqhh1q5Q==
"@types/url-parse@^1.4.5":
version "1.4.5"
resolved "https://registry.yarnpkg.com/@types/url-parse/-/url-parse-1.4.5.tgz#bda0b813cc8f79d767dc8ca645fdabc238c6ae77"
integrity sha512-8Wje3itJpk/FX+QItca9vjNLjGx5jlEYBw/CpMi03Fphk2DSVeZDUqWTE81BeCI5Bl6Z+zmA1O9L/8e3ZUSeLg==
"@types/uuid@^8.3.3":
version "8.3.3"