mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 17:53:39 +00:00
Resolve state <-> state-test-utils circular dependency (#16093)
* Resolve state <-> state-test-utils circular dependency * Fix type errors
This commit is contained in:
@@ -4,8 +4,6 @@ import { Jsonify } from "type-fest";
|
||||
|
||||
import { array, record } from "@bitwarden/serialization";
|
||||
|
||||
import { StorageKey } from "../types/state";
|
||||
|
||||
import { StateDefinition } from "./state-definition";
|
||||
|
||||
export type DebugOptions = {
|
||||
@@ -172,12 +170,3 @@ export class KeyDefinition<T> {
|
||||
return `${this.stateDefinition.name} > ${this.key}`;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a {@link StorageKey}
|
||||
* @param keyDefinition The key definition of which data the key should point to.
|
||||
* @returns A key that is ready to be used in a storage service to get data.
|
||||
*/
|
||||
export function globalKeyBuilder(keyDefinition: KeyDefinition<unknown>): StorageKey {
|
||||
return `global_${keyDefinition.stateDefinition.name}_${keyDefinition.key}` as StorageKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user