-
-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
I noticed that the types for the resolve method on CompositeDidDocumentResolver does not accept any input did, and isDid returns an incompatible type:
import { isDid } from "@atcute/lexicons/syntax";
import {
CompositeDidDocumentResolver,
PlcDidDocumentResolver,
WebDidDocumentResolver,
} from "@atcute/identity-resolver";
const argv = process.argv.slice(2);
const did = isDid(argv[0])
const didResolver = new CompositeDidDocumentResolver({
methods: {
plc: new PlcDidDocumentResolver(),
web: new WebDidDocumentResolver(),
},
})
didResolver.resolve(did) // Type Error: Type '`did:${string}:${string}`' is not assignable to type '`did:plc:${string}` | `did:web:${string}` | undefined'.Perhaps there should be a isAtDid or something that narrows to did:plc: or did:web:? I can of course cast to AtprotoDid fine too, but it was a little unexpected when working with the atcute APIs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels