felixgirault/essence.js

View on GitHub
src/preparators/refactorRequestUrl.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 *
 */
export default function refactorRequestUrl(
    regex,
    replacement,
    {req, ...payload}
) {
    return {
        ...payload,
        req: req.withUrl(
            req.url().replace(
                regex,
                replacement
            )
        )
    };
}