Skip to content

Commit

Permalink
style: apply lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
allohamora committed Sep 12, 2023
1 parent a1a9bd4 commit 8ddc4e4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/env/env.picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ export const wrapInEnvPickers = <NodeEnv extends string, Config extends BaseConf
config: Config,
nodeEnv: NodeEnv,
): WrappedInEnvPickers<NodeEnv, Config> => {
return Object.keys(config).reduce((result, key) => {
return { ...result, [key]: new EnvPicker(config[key], nodeEnv) };
}, {} as WrappedInEnvPickers<NodeEnv, Config>);
return Object.keys(config).reduce(
(result, key) => {
return { ...result, [key]: new EnvPicker(config[key], nodeEnv) };
},
{} as WrappedInEnvPickers<NodeEnv, Config>,
);
};

export class EnvPicker<NodeEnv extends string, State> {
constructor(private state: State, private nodeEnv: NodeEnv) {}
constructor(
private state: State,
private nodeEnv: NodeEnv,
) {}

public default<NewState extends State>(newState: NewState): EnvPicker<NodeEnv, NewState | NonNullable<State>> {
this.state ??= newState;
Expand Down

0 comments on commit 8ddc4e4

Please sign in to comment.