From e9f355ccabe03f347bdda398363ba044b22a665e Mon Sep 17 00:00:00 2001 From: yarastqt Date: Sat, 25 Apr 2020 21:49:23 +0300 Subject: [PATCH] fix: platforms are optional --- src/core/project-config.ts | 4 ++-- src/core/theme-layers.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/project-config.ts b/src/core/project-config.ts index 0d872ac..7ef9c3d 100644 --- a/src/core/project-config.ts +++ b/src/core/project-config.ts @@ -5,10 +5,10 @@ import { Platforms } from './platforms' export type Config = { src: string - outDir: string - platforms: Platforms + platforms?: Platforms formats: { [key: string]: { + outDir: string transforms: string[] options?: {} } diff --git a/src/core/theme-layers.ts b/src/core/theme-layers.ts index b2ef7f2..8d9870b 100644 --- a/src/core/theme-layers.ts +++ b/src/core/theme-layers.ts @@ -16,7 +16,7 @@ type ThemeLayers = Shape< export async function getThemeLayers( source: string, - options?: { platforms: Platforms }, + options: { platforms?: Platforms } = {}, ): Promise { const result: ThemeLayers = {} // @ts-ignore @@ -27,7 +27,7 @@ export async function getThemeLayers( const data = typeof maybeFn === 'function' ? maybeFn() : maybeFn const { name: layer } = parse(fileName) for (const [platform, levels] of platforms) { - if (options !== undefined && !options.platforms.includes(platform)) { + if (options.platforms !== undefined && !options.platforms.includes(platform)) { continue } const composedLevels = []