mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Bump typescript, @typescript-eslint/eslint-plugin, and @typescript-eslint/parser (#6143)
This commit is contained in:
1 parent
27871f57b6
commit
b0d72b78d0
16 files changed
+105
-118
No files matched your search
@@ -4,6 +4,7 @@
|
||||
*/
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import { reaction, when } from "mobx";
|
||||
import type { GeneralEntity } from "../../../common/catalog-entities";
|
||||
import generalCategoryInjectable from "../../../common/catalog/categories/general.injectable";
|
||||
import isActiveRouteInjectable from "../../navigation/is-route-active.injectable";
|
||||
import observableHistoryInjectable from "../../navigation/observable-history.injectable";
|
||||
@@ -30,7 +31,7 @@ const watchForGeneralEntityNavigationInjectable = getInjectable({
|
||||
dispose.push(reaction(
|
||||
() => observableHistory.location,
|
||||
() => {
|
||||
const entities = entityRegistry.getItemsForCategory(generalCategory);
|
||||
const entities = entityRegistry.getItemsForCategory(generalCategory) as GeneralEntity[];
|
||||
const activeEntity = entities.find(entity => isActiveRoute(entity.spec.path));
|
||||
|
||||
if (activeEntity) {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import { asLegacyGlobalFunctionForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/as-legacy-global-function-for-extension-api";
|
||||
import { asLegacyGlobalForExtensionApi } from "../../extensions/as-legacy-globals-for-extension-api/as-legacy-global-object-for-extension-api";
|
||||
import matchRouteInjectable from "./match-route.injectable";
|
||||
import navigateInjectable from "./navigate.injectable";
|
||||
import observableHistoryInjectable from "./observable-history.injectable";
|
||||
|
||||
@@ -21,9 +20,4 @@ export const navigation = asLegacyGlobalForExtensionApi(observableHistoryInjecta
|
||||
*/
|
||||
export const navigate = asLegacyGlobalFunctionForExtensionApi(navigateInjectable);
|
||||
|
||||
/**
|
||||
* @deprecated use `di.inject(matchRouteInjectable)` instead
|
||||
*/
|
||||
export const matchRoute = asLegacyGlobalFunctionForExtensionApi(matchRouteInjectable);
|
||||
|
||||
export * from "./page-param";
|
||||
@@ -7,7 +7,7 @@ import type { match, RouteProps } from "react-router";
|
||||
import { matchPath } from "react-router";
|
||||
import observableHistoryInjectable from "./observable-history.injectable";
|
||||
|
||||
export type MatchRoute = <Params>(route: string | string[] | RouteProps) => match<Params> | null;
|
||||
export type MatchRoute = <Params extends { [K in keyof Params]?: string }>(route: string | string[] | RouteProps) => match<Params> | null;
|
||||
|
||||
const matchRouteInjectable = getInjectable({
|
||||
id: "match-route",
|
||||
|
||||
@@ -9,6 +9,7 @@ import type { Draft } from "immer";
|
||||
import { produce, isDraft } from "immer";
|
||||
import { isEqual, isPlainObject } from "lodash";
|
||||
import logger from "../../main/logger";
|
||||
import assert from "assert";
|
||||
|
||||
export interface StorageChange<T> {
|
||||
key: string;
|
||||
@@ -154,8 +155,9 @@ export class StorageHelper<T> implements StorageLayer<T> {
|
||||
}
|
||||
|
||||
@action
|
||||
merge(value: Partial<T> | ((draft: Draft<T>) => Partial<T> | void)) {
|
||||
merge(value: T extends object ? Partial<T> | ((draft: Draft<T>) => Partial<T> | void) : never) {
|
||||
const nextValue = produce<T>(toJS(this.get()), (draft) => {
|
||||
assert(typeof draft === "object" && draft);
|
||||
|
||||
if (typeof value == "function") {
|
||||
const newValue = value(draft);
|
||||
|
||||
Reference in new issue
Block a user