1 | const { compose, composeP, lensProp } = require('ramda');
|
2 | const { overA } = require('./lens-utils');
|
3 |
|
4 | const commits = lensProp('commits');
|
5 | const nextRelease = lensProp('nextRelease');
|
6 | const version = lensProp('version');
|
7 |
|
8 | const mapCommits = fn => overA(commits, async commits => await fn(commits));
|
9 |
|
10 | const mapNextReleaseVersion = overA(compose(nextRelease, version));
|
11 |
|
12 | const withOptionsTransforms = transforms => plugin => async (
|
13 | pluginConfig,
|
14 | config
|
15 | ) => {
|
16 | return plugin(pluginConfig, await composeP(...transforms)(config));
|
17 | };
|
18 |
|
19 | module.exports = {
|
20 | mapCommits,
|
21 | mapNextReleaseVersion,
|
22 | withOptionsTransforms,
|
23 | };
|