format this javascript function as if was a rust function.

```
export const hashOutputs = (
  {
    correspondingOutput,
    signingSerializationType,
    transactionOutputs,
  }: {
    /**
     * The signing serialization type to test
     */
    signingSerializationType: Uint8Array;
    /**
     * See {@link generateSigningSerializationComponentsBCH}
     */
    transactionOutputs: Uint8Array;
    /**
     * See {@link generateSigningSerializationComponentsBCH}
     */
    correspondingOutput: Uint8Array | undefined;
  },
  sha256: { hash: Sha256['hash'] } = internalSha256
) =>
  !shouldSerializeCorrespondingOutput(signingSerializationType) &&
  !shouldSerializeNoOutputs(signingSerializationType)
    ? hash256(transactionOutputs, sha256)
    : shouldSerializeCorrespondingOutput(signingSerializationType)
    ? correspondingOutput === undefined
      ? emptyHash()
      : hash256(correspondingOutput, sha256)
    : emptyHash();
```