Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Allows pipe transform return to be optional

Compare
Choose a tag to compare
@jamesseanwright jamesseanwright released this 19 Nov 12:11
· 461 commits to master since this release

This avoids redundantly returning the received response from a pipe transformation when mutating said response:

const withCaching = pipe(
  (req, res) => {
    res.headers.append("Cache-Control", "max-age=86400");
    // no return statement required
  }
);