"Fossies" - the Fresh Open Source Software Archive

Member "lens-6.2.5/src/migrations/user-store/5.0.0-alpha.3.ts" (6 Dec 2022, 672 Bytes) of package /linux/misc/lens-6.2.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /**
    2  * Copyright (c) OpenLens Authors. All rights reserved.
    3  * Licensed under MIT License. See LICENSE in root directory for more information.
    4  */
    5 
    6 // Switch representation of hiddenTableColumns in store
    7 import type { MigrationDeclaration } from "../helpers";
    8 
    9 export default {
   10   version: "5.0.0-alpha.3",
   11   run(store) {
   12     const preferences = store.get("preferences");
   13     const oldHiddenTableColumns: Record<string, string[]> = preferences?.hiddenTableColumns;
   14 
   15     if (!oldHiddenTableColumns) {
   16       return;
   17     }
   18 
   19     preferences.hiddenTableColumns = Object.entries(oldHiddenTableColumns);
   20 
   21     store.set("preferences", preferences);
   22   },
   23 } as MigrationDeclaration;