Skip to content

Commit a579e4b

Browse files
committed
Give up on shorter path
1 parent 8967ddf commit a579e4b

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

src/bin/css_to_ts/colorOptions.ts

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -432,32 +432,6 @@ export function generateGetColorOptionsTsCode(colorOptions: ColorOption[]) {
432432
req(obj, colorOption.themePath);
433433
});
434434

435-
Object.values(obj).forEach((obj: any) => {
436-
/*
437-
obj=
438-
{
439-
"sun113_625": {
440-
"default": isDark ? "#a00000" : "#00000d",
441-
"active": isDark ? "#b00000" : "#00000e"
442-
},
443-
"main525": {
444-
"default": "#00000f"
445-
}
446-
}
447-
*/
448-
449-
Object.entries(obj as any).forEach(([key, subObj]: any) => {
450-
//key = main525
451-
//subObj = { "default": "#00000f" }
452-
453-
const keys = Object.keys(subObj as any);
454-
455-
if (keys.length === 1 && keys[0] === "default") {
456-
obj[key] = subObj.default;
457-
}
458-
});
459-
});
460-
461435
return [
462436
`export function getColorOptions(colorScheme: ColorScheme) {`,
463437
` const isDark: boolean = (() => {`,

src/test/bin/colorOptions/generateGetColorOptionsTsCode.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ export function getColorOptions(colorScheme: ColorScheme) {
121121
"default": isDark ? "#a00000" : "#00000d",
122122
"active": isDark ? "#b00000" : "#00000e"
123123
},
124-
"main525": "#00000f"
124+
"main525": {
125+
"default": "#00000f"
126+
}
125127
},
126128
"purpleGlycine": {
127129
"sun319moon630": {

0 commit comments

Comments
 (0)