Skip to content

Commit

Permalink
fix: platforms are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
yarastqt committed Apr 25, 2020
1 parent 49ce746 commit e9f355c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/project-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?: {}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/theme-layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type ThemeLayers = Shape<

export async function getThemeLayers(
source: string,
options?: { platforms: Platforms },
options: { platforms?: Platforms } = {},
): Promise<ThemeLayers> {
const result: ThemeLayers = {}
// @ts-ignore
Expand All @@ -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 = []
Expand Down

0 comments on commit e9f355c

Please sign in to comment.