mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
⚙️ Refactor getInitialSettings(), delete unused functions
This commit is contained in:
@@ -21,7 +21,7 @@ function getInitialSettings(): Settings {
|
||||
if (stored) {
|
||||
const parsedSettings = JSON.parse(stored) as Partial<Settings>;
|
||||
return {
|
||||
packageManager: isValidPackageManager(parsedSettings.packageManager)
|
||||
packageManager: parsedSettings.packageManager
|
||||
? parsedSettings.packageManager
|
||||
: defaultSettings.packageManager,
|
||||
optimizeSvgs:
|
||||
@@ -37,12 +37,6 @@ function getInitialSettings(): Settings {
|
||||
return defaultSettings;
|
||||
}
|
||||
|
||||
function isValidPackageManager(value: unknown): value is PackageManager {
|
||||
return (
|
||||
value === "npm" || value === "pnpm" || value === "yarn" || value === "bun"
|
||||
);
|
||||
}
|
||||
|
||||
function createSettingsStore() {
|
||||
const { subscribe, set, update } = writable<Settings>(getInitialSettings());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user