Skip to content

Commit

Permalink
updating inferred const types
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbarbour committed Dec 22, 2024
1 parent ecd882d commit 18658dd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
19 changes: 10 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"jest-mock-extended": "^3.0.5",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2",
"typescript": "^5.7.2",
"@rollup/plugin-commonjs": "^25.0.5",
"@rollup/plugin-json": "^6.0.1",
"@rollup/plugin-node-resolve": "^15.2.3",
Expand Down
6 changes: 3 additions & 3 deletions src/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class EnvironmentBuilder<E = unknown, O = unknown> {
return new EnvironmentBuilder({ ...this.info, optionalKeys: [...this.info. optionalKeys, ...vars] });
}

defaults(defaultValues: Partial<E> = {}): EnvironmentBuilder<E, O> {
defaults(defaultValues: Partial<E>): EnvironmentBuilder<E, O> {
return new EnvironmentBuilder({ ...this.info, defaultValues });
}

Expand All @@ -36,8 +36,8 @@ export class EnvironmentBuilder<E = unknown, O = unknown> {
return allEnvs as any;
}

static create<S extends string[]>(...vars: S): EnvironmentBuilder<{ [K in keyof MapNamesToKeys<S>]: MapNamesToKeys<S>[K] }, {}> {
return new EnvironmentBuilder({ requiredKeys: vars, optionalKeys: [], defaultValues: {}, transforms: {} });
static create<const S extends string[]>(...vars: S): EnvironmentBuilder<{ [K in keyof MapNamesToKeys<S>]: MapNamesToKeys<S>[K] }, {}> {
return new EnvironmentBuilder({ requiredKeys: vars, optionalKeys: [], defaultValues: {}, transforms: {} }) as any;
}

private requiredEnvs(environment: any): { errors: string[], requiredEnvs: any } {
Expand Down

0 comments on commit 18658dd

Please sign in to comment.