The object to be checked.
true
if obj
is a DidVerificationMethod
; otherwise, false
.
const resource = {
id : "did:example:123#0",
type : "JsonWebKey2020",
controller : "did:example:123",
publicKeyJwk : { ... }
};
if (isDidVerificationMethod(resource)) {
console.log('The resource is a DidVerificationMethod');
} else {
console.log('The resource is not a DidVerificationMethod');
}
Checks if a given object is a DID Verification Method.
A DidVerificationMethod in the context of DID resources must include the properties
id
,type
, andcontroller
.