Rename config to settings
This commit is contained in:
17
tools/settings.ts
Normal file
17
tools/settings.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
export function loadSettings(path: string): Settings | null {
|
||||
const item = localStorage.getItem(path);
|
||||
if (!item) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return JSON.parse(item) as Settings;
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
searchUrl: string;
|
||||
searchBar: boolean,
|
||||
}
|
||||
Reference in New Issue
Block a user