Skip to content

Commit

Permalink
refactor: if should not be the only statement in else blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Apr 22, 2024
1 parent 96b15a9 commit a6b716b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/jwe/flattened/encrypt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,10 @@ export class FlattenedEncrypt {
} else {
this._unprotectedHeader = { ...this._unprotectedHeader, ...parameters }
}
} else if (!this._protectedHeader) {
this.setProtectedHeader(parameters)
} else {
if (!this._protectedHeader) {
this.setProtectedHeader(parameters)
} else {
this._protectedHeader = { ...this._protectedHeader, ...parameters }
}
this._protectedHeader = { ...this._protectedHeader, ...parameters }
}
}
}
Expand Down

0 comments on commit a6b716b

Please sign in to comment.