• Checks if a given object is a DidService.

    A DidService in the context of DID resources must include the properties id, type, and serviceEndpoint. The serviceEndpoint can be a DidServiceEndpoint or an array of DidServiceEndpoint objects.

    Parameters

    • obj: unknown

      The object to be checked.

    Returns obj is DidService

    true if obj is a DidService; otherwise, false.

    Example

    const service = {
    id: "did:example:123#service-1",
    type: "OidcService",
    serviceEndpoint: "https://example.com/oidc"
    };

    if (isDidService(service)) {
    console.log('The object is a DidService');
    } else {
    console.log('The object is not a DidService');
    }