Make type optional
This commit is contained in:
@@ -14,7 +14,7 @@ export interface IBaseColorSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface IColorSet {
|
export interface IColorSet {
|
||||||
type: 'light' | 'dark';
|
type?: 'light' | 'dark';
|
||||||
base: IBaseColorSet;
|
base: IBaseColorSet;
|
||||||
syntax?: {
|
syntax?: {
|
||||||
boolean?: string;
|
boolean?: string;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export interface IVscodeJsonTheme {
|
|||||||
export class VscodeThemeGenerator implements IThemeGenerator {
|
export class VscodeThemeGenerator implements IThemeGenerator {
|
||||||
public generateTheme(name: string, colorSet: IColorSet): string {
|
public generateTheme(name: string, colorSet: IColorSet): string {
|
||||||
// Fill in missing subsets to prevent NPEs
|
// Fill in missing subsets to prevent NPEs
|
||||||
|
if (!colorSet.type) colorSet.type = 'dark';
|
||||||
if (!colorSet.syntax) colorSet.syntax = {};
|
if (!colorSet.syntax) colorSet.syntax = {};
|
||||||
if (!colorSet.terminal) colorSet.terminal = {};
|
if (!colorSet.terminal) colorSet.terminal = {};
|
||||||
if (!colorSet.ui) colorSet.ui = {};
|
if (!colorSet.ui) colorSet.ui = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user