mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-30 04:11:57 +00:00
chore: charlie 14
This commit is contained in:
@@ -14,8 +14,14 @@ import { TypeFromProps } from "../util/propertiesMatcher";
|
||||
export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
|
||||
spec: Config<A>;
|
||||
dependsOn: DependsOn;
|
||||
write(options: { effects: Effects; input: TypeFromProps<A> }): Promise<ConfigType>;
|
||||
read(options: { effects: Effects; config: ConfigType }): Promise<null | DeepPartial<TypeFromProps<A>>>;
|
||||
write(options: {
|
||||
effects: Effects;
|
||||
input: TypeFromProps<A>;
|
||||
}): Promise<ConfigType>;
|
||||
read(options: {
|
||||
effects: Effects;
|
||||
config: ConfigType;
|
||||
}): Promise<null | DeepPartial<TypeFromProps<A>>>;
|
||||
}) {
|
||||
const validator = options.spec.validator();
|
||||
return {
|
||||
@@ -30,7 +36,9 @@ export function setupConfigExports<A extends InputSpec, ConfigType>(options: {
|
||||
getConfig: (async ({ effects, config }) => {
|
||||
return {
|
||||
spec: options.spec.build(),
|
||||
config: nullIfEmpty(await options.read({ effects, config: config as ConfigType })),
|
||||
config: nullIfEmpty(
|
||||
await options.read({ effects, config: config as ConfigType })
|
||||
),
|
||||
};
|
||||
}) as ExpectedExports.getConfig,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user