Skip to content

Commit 5ea6d50

Browse files
shorter form of setting uninitialized value
Co-authored-by: Jan Romann <jan.romann@uni-bremen.de>
1 parent b8e3d6e commit 5ea6d50

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/core/src/consumed-thing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ export default class ConsumedThing extends TD.Thing implements IConsumedThing {
566566
outputDataSchema: WoT.DataSchema | undefined
567567
): InteractionOutput {
568568
// infer media type from form if not in response metadata
569-
if (!content.type) content.type = form.contentType ?? "application/json";
569+
content.type ??= form.contentType ?? "application/json";
570570

571571
// check if returned media type is the same as expected media type (from TD)
572572
if (form.response != null) {

0 commit comments

Comments
 (0)