mirror of
https://github.com/Boof2015/prism.git
synced 2026-08-18 19:44:16 +02:00
changes (theres too many)
This commit is contained in:
@@ -156,7 +156,6 @@ export function normalizeProfileName(value: unknown, fallback = DEFAULT_PROFILE_
|
||||
export function createDefaultProfile(name = DEFAULT_PROFILE_NAME): Profile {
|
||||
return {
|
||||
name,
|
||||
themeId: null,
|
||||
scopeOrder: [...DEFAULT_SCOPE_ORDER],
|
||||
hiddenScopes: SCOPE_KINDS.filter((kind) => !DEFAULT_VISIBLE.includes(kind)),
|
||||
widthWeights: { ...DEFAULT_SCOPE_WIDTH_WEIGHTS },
|
||||
@@ -172,9 +171,6 @@ export function normalizeProfile(raw: unknown, fallbackName = DEFAULT_PROFILE_NA
|
||||
|
||||
return {
|
||||
name: normalizeProfileName(parsed.name, fallbackName),
|
||||
themeId: typeof parsed.themeId === 'string' && parsed.themeId.trim()
|
||||
? parsed.themeId.trim()
|
||||
: null,
|
||||
scopeOrder: normalizeScopeOrder(parsed.scopeOrder),
|
||||
hiddenScopes: normalizeHiddenScopes(parsed.hiddenScopes),
|
||||
widthWeights: normalizeWidthWeights(parsed.widthWeights),
|
||||
@@ -195,14 +191,6 @@ export function normalizeProfileFileScopePopouts(raw: unknown): PrismProfileFile
|
||||
}, {} as PrismProfileFileScopePopoutMap)
|
||||
}
|
||||
|
||||
function readProfileFileThemeId(file: Partial<PrismProfileFile> | PrismProfileFile): string | null {
|
||||
if (!('themeId' in file)) return null
|
||||
const { themeId } = file
|
||||
return typeof themeId === 'string' && themeId.trim()
|
||||
? themeId.trim()
|
||||
: null
|
||||
}
|
||||
|
||||
export function normalizeProfileFile(
|
||||
raw: unknown,
|
||||
fallbackId: string,
|
||||
@@ -223,7 +211,6 @@ export function normalizeProfileFile(
|
||||
version: PROFILE_FILE_VERSION,
|
||||
id,
|
||||
name,
|
||||
themeId: readProfileFileThemeId(parsed),
|
||||
scopeOrder: normalizeScopeOrder(parsed.scopeOrder),
|
||||
hiddenScopes: normalizeHiddenScopes(parsed.hiddenScopes),
|
||||
widthWeights: normalizeWidthWeights(parsed.widthWeights),
|
||||
@@ -240,7 +227,6 @@ export function profileToFileData(id: string, profile: Profile): PrismProfileFil
|
||||
version: PROFILE_FILE_VERSION,
|
||||
id,
|
||||
name: normalized.name,
|
||||
themeId: normalized.themeId,
|
||||
scopeOrder: [...normalized.scopeOrder],
|
||||
hiddenScopes: [...normalized.hiddenScopes],
|
||||
widthWeights: { ...normalized.widthWeights },
|
||||
@@ -333,7 +319,6 @@ export function profileFileToProfile(
|
||||
|
||||
return {
|
||||
name: normalizeProfileName(file.name, DEFAULT_PROFILE_NAME),
|
||||
themeId: readProfileFileThemeId(file),
|
||||
scopeOrder: normalizeScopeOrder(file.scopeOrder),
|
||||
hiddenScopes: normalizeHiddenScopes(file.hiddenScopes),
|
||||
widthWeights: normalizeWidthWeights(file.widthWeights),
|
||||
|
||||
Reference in New Issue
Block a user