Skip to content

Add types in function update JWE constructor to improve readability #361

@Exodiel

Description

@Exodiel
const encrypt = async (publicToEncrypt: JWK.Key, data: JWS.CreateSignResult): Promise<string> => {
  const encrypted = await JWE
    .createEncrypt({
      contentAlg: 'A256GCM',
      format: 'compact',
      fields: {
        alg: 'RSA-OAEP-256',
        cty: 'JWT',
        enc: 'A256GCM',
        iss: 'COMPANY'
      }
    }, publicToEncrypt)
    .update(data) // <--- here
    .final()

  return encrypted
}

In the update function, the input data is received as a parameter but the data type is any
Here is what I am saying:

(method) JWE.Encryptor.update(input: any): JWE.Encryptor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions