Skip to content

Commit

Permalink
Replace lodash by ramda
Browse files Browse the repository at this point in the history
  • Loading branch information
lo1tuma committed Mar 5, 2016
1 parent f5838e8 commit b7c914e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ var ensureCleanLocalGitState = require('./ensureCleanLocalGitState'),
Promise = require('bluebird'),
path = require('path'),
prependFile = Promise.promisify(require('prepend')),
getGithubRepo = require('./getGithubRepo'),
_ = require('lodash');
getGithubRepo = require('./getGithubRepo');

function stripTrailingEmptyLine(text) {
if (_.endsWith(text, '\n\n')) {
if (text.indexOf('\n\n') === text.length - 2) {
return text.slice(0, -1);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/createChangelog.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';

var validLabels = require('./validLabels'),
groupBy = require('lodash/collection/groupBy'),
R = require('ramda'),
util = require('util'),
moment = require('moment');

module.exports = function createChangelog(newVersionNumber, mergedPullRequests) {
var changelog,
groupedPullRequests = groupBy(mergedPullRequests, 'label'),
groupedPullRequests = R.groupBy(R.prop('label'), mergedPullRequests),
date = moment().locale('en').format('MMMM D, YYYY'),
title = util.format('## %s (%s)', newVersionNumber, date);

Expand Down
6 changes: 3 additions & 3 deletions lib/findRemoteAlias.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

var git = require('git-promise'),
parseGitUrl = require('git-url-parse'),
find = require('lodash/collection/find');
R = require('ramda');

function isSameGitUrl(gitUrlA, gitUrlB) {
var parsedUrlA = parseGitUrl(gitUrlA),
Expand Down Expand Up @@ -34,9 +34,9 @@ module.exports = function findRemoteAlias(githubRepo) {
}),
matchedRemote;

matchedRemote = find(remotes, function (remote) {
matchedRemote = R.find(function (remote) {
return remote.url && isSameGitUrl(gitRemote, remote.url);
});
}, remotes);

if (!matchedRemote) {
throw new Error('This local git repository doesn’t have a remote pointing to ' + gitRemote);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"bluebird": "2.9.30",
"commander": "2.8.1",
"git-promise": "0.2.0",
"lodash": "3.9.3",
"ramda": "0.19.1",
"moment": "2.10.3",
"git-url-parse": "6.0.1",
"parse-github-repo-url": "1.0.0",
Expand Down

0 comments on commit b7c914e

Please sign in to comment.