Skip to content

Commit

Permalink
refactor: simplification proposed by Jan
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeintner committed Sep 25, 2023
1 parent 50f06b3 commit 994e1a7
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/core/src/codecs/json-codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ export default class JsonCodec implements ContentCodec {
private subMediaType: string;

constructor(subMediaType?: string) {
if (subMediaType == null) {
this.subMediaType = ContentSerdes.DEFAULT; // 'application/json'
} else {
this.subMediaType = subMediaType;
}
this.subMediaType = subMediaType ?? ContentSerdes.DEFAULT;
}

getMediaType(): string {
Expand Down

0 comments on commit 994e1a7

Please sign in to comment.