UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

27 lines (25 loc) 852 B
import { getAssetsImportPromises } from "../getAssetsImportPromises"; import { themeAppearanceImports, themeAppearanceMapping } from "../themeAppearanceAssetsConfig"; import { validateAndLogError } from "../errorValidation"; import { LIBRARIES, THEME_APPEARANCES } from "../constants"; export function getThemeAppearanceAssetPromise({ themeAppearance }) { const isError = validateAndLogError({ options: THEME_APPEARANCES, value: themeAppearance, type: 'themeAppearance' }); if (!isError) { const assetImportKeys = []; LIBRARIES.map(library => { const assetImportKey = themeAppearanceMapping[library][themeAppearance]; assetImportKeys.push(assetImportKey); }); return getAssetsImportPromises({ assetImportKeys: assetImportKeys, assetImports: themeAppearanceImports }); } return []; }