File

libs/oauth/src/lib-test/mock-storage.ts

Index

Methods

Methods

getItem
getItem(key: string)
Parameters :
Name Type Optional
key string No
Returns : string | null
removeItem
removeItem(key: string)
Parameters :
Name Type Optional
key string No
Returns : void
setItem
setItem(key: string, value: string)
Parameters :
Name Type Optional
key string No
value string No
Returns : void
export class MockStorage {
  private items = new Map<string, string>();

  setItem(key: string, value: string): void {
    this.items.set(key, value);
  }

  getItem(key: string): string | null {
    return this.items.get(key) ?? null;
  }

  removeItem(key: string): void {
    this.items.delete(key);
  }
}

results matching ""

    No results matching ""