felixgirault/essence.js

View on GitHub
src/presenters/fillResponseUrl.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 *
 */
export default function fillResponseUrl({req, res}) {
    const filledRes =
        (!res.isEmpty() && !res.has('url'))
            ? res.withProp('url', req.url())
            : res;

    return {
        req,
        res: filledRes
    };
}