Make type optional

This commit is contained in:
Daniel Imms
2018-05-28 06:36:17 -07:00
parent 2eb510f6cc
commit 8bbcf0c3c4
2 changed files with 2 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ export interface IBaseColorSet {
}
export interface IColorSet {
type: 'light' | 'dark';
type?: 'light' | 'dark';
base: IBaseColorSet;
syntax?: {
boolean?: string;

View File

@@ -12,6 +12,7 @@ export interface IVscodeJsonTheme {
export class VscodeThemeGenerator implements IThemeGenerator {
public generateTheme(name: string, colorSet: IColorSet): string {
// Fill in missing subsets to prevent NPEs
if (!colorSet.type) colorSet.type = 'dark';
if (!colorSet.syntax) colorSet.syntax = {};
if (!colorSet.terminal) colorSet.terminal = {};
if (!colorSet.ui) colorSet.ui = {};