Skip to content

Commit

Permalink
Merge pull request #10 from SocketDev/make-transform-optional
Browse files Browse the repository at this point in the history
Make transformer.transform optional
  • Loading branch information
feross authored Apr 21, 2021
2 parents be402be + e998d4b commit dcb275b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/transform-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ class TransformStreamSource {
controller.close()
return
}
await this.transformer.transform(data.value, wrappedController)
if (this.transformer.transform) {
await this.transformer.transform(data.value, wrappedController)
} else {
wrappedController.enqueue(data.value)
}
}
}

Expand Down

0 comments on commit dcb275b

Please sign in to comment.