Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(lib/data): monorepo #30210

Merged
merged 23 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/config/presets/internal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import * as workaroundsPreset from './workarounds';

/* eslint sort-keys: ["error", "asc", {caseSensitive: false, natural: true}] */

export const groups: Record<string, Record<string, Preset>> = {
export const groups: Record<
string,
Record<string, Preset> | Promise<Record<string, Preset>>
> = {
config: configPreset.presets,
customManagers: customManagersPreset.presets,
default: defaultPreset.presets,
Expand All @@ -35,11 +38,10 @@ export const groups: Record<string, Record<string, Preset>> = {
workarounds: workaroundsPreset.presets,
};

export function getPreset({
export async function getPreset({
repo,
presetName,
}: PresetConfig): Preset | undefined {
return groups[repo] && presetName
? groups[repo][presetName]
: /* istanbul ignore next */ undefined;
}: PresetConfig): Promise<Preset | undefined> {
const pres = await groups[repo];
return pres && presetName ? pres[presetName] : undefined;
}
Loading
Loading