Skip to content

Commit 19eadfa

Browse files
chore: fix storage helper function and useguard return type (#124)
1 parent 0ebac0d commit 19eadfa

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

apps/vue-showcase/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,5 @@ module.exports = {
8787
},
8888
},
8989
},
90-
],
90+
]
9191
};

libs/vue-route-guard/src/lib/helpers.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function getVueVersion(app: typeof Vue): number {
3838
export function isStorageAvailable(storage: StorageType): boolean {
3939
const storageValue = window[storage];
4040
if (
41-
!!storageValue ||
41+
!storageValue ||
4242
typeof storageValue !== 'object' ||
4343
typeof (storageValue as Storage).setItem !== 'function' ||
4444
typeof (storageValue as Storage).removeItem !== 'function'

libs/vue-route-guard/src/lib/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ export function setupGuard(options: GuardConfig) {
1414
return new Guard(options, packageKey);
1515
}
1616

17-
export function useGuard() {
18-
return Vue.inject(packageKey);
17+
export function useGuard(): Guard {
18+
return Vue.inject(packageKey) as Guard;
1919
}

0 commit comments

Comments
 (0)