Skip to content

Commit

Permalink
refactor: [GSW-2032] Improve storage getter return type safety
Browse files Browse the repository at this point in the history
Refactor this getter to return a value.
Getters and setters should access the expected fields typescript:S4275
Software qualities impacted:
Reliability
  • Loading branch information
tfrg committed Dec 17, 2024
1 parent 9a1353e commit fd1d2f2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ export class WebStorageClient implements StorageClient {
this.storageType = storageType;
}

get storage() {
if (!window) {
return;
get storage(): Storage | null {
if (typeof window === "undefined") {
return null;
}
if (this.storageType === "LOCAL") {
return window.localStorage;
Expand Down

0 comments on commit fd1d2f2

Please sign in to comment.