Skip to content

Commit

Permalink
types: Guarantee keys in PromisedGetStub
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Frank committed Jun 14, 2022
1 parent f0e4c62 commit 1363739
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ticketbridge/hyper-durable",
"version": "0.1.13",
"version": "0.1.14",
"description": "Object-like access to Durable Object properties and methods",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/HyperNamespaceProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export const proxyHyperDurables = <DO extends HyperDurable<any, Env>, Env>(
doBindings: { [key: string]: new (state: DurableObjectState, env: Env) => DO }
) => {
const newEnv: {
[Prop in keyof typeof doBindings]?: HyperNamespaceProxy<DO, Env>
[Prop in keyof typeof doBindings]: HyperNamespaceProxy<DO, Env>
} = {};
for (const [key, value] of Object.entries(doBindings)) {
if (!(value.prototype instanceof HyperDurable)) {
Expand Down
2 changes: 1 addition & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class HyperDurable<T extends object, Env = unknown> {
}

export type PromisedGetStub<DO extends HyperDurable<any, Env>, Env> = {
[Prop in keyof DO]?:
[Prop in keyof DO]:
DO[Prop] extends (...args: any) => any
? (...args: Parameters<DO[Prop]>) => Promise<ReturnType<DO[Prop]>>
: Promise<DO[Prop]>;
Expand Down

0 comments on commit 1363739

Please sign in to comment.