_.unique -> _.uniq && _.pluck -> _.map

This commit is contained in:
spalger
2016-05-19 07:31:15 -07:00
parent d1e5940f73
commit bd93bc914c
3 changed files with 14 additions and 8 deletions

View File

@ -88,7 +88,7 @@ module.exports = function (branch, done) {
apiSpec = {
actions: groups.normal || [],
proxies: groups.proxies || [],
namespaces: _.unique(namespaces.sort(), true),
namespaces: _.uniq(namespaces.sort(), true),
clientActionModifier: overrides.clientActionModifier
};
@ -252,8 +252,14 @@ module.exports = function (branch, done) {
});
});
if (urlSignatures.length !== _.unique(urlSignatures).length) {
throw new Error('Multiple URLS with the same signature detected for ' + spec.name + '\n' + _.pluck(urls, 'fmt').join('\n') + '\n');
if (urlSignatures.length !== _.uniq(urlSignatures).length) {
throw new Error(
'Multiple URLS with the same signature detected for ' +
spec.name +
'\n' +
_.map(urls, 'fmt').join('\n') +
'\n'
);
}
if (urls.length > 1) {

View File

@ -32,7 +32,7 @@ process.once('message', function (port) {
var out = {
socketCount: err || sockets.length,
remaining: _.where(sockets, { destroyed: true }).length - sockets.length,
timeouts: _.size(clock.timers) && _.pluck(clock.timers, 'func').map(String)
timeouts: _.size(clock.timers) && _.map(clock.timers, 'func').map(String)
};
clock.restore();

View File

@ -112,7 +112,7 @@ module.exports = {
snapshot: '_all'
})
.then(function (resp) {
return _.pluck(resp.snapshots, 'snapshot');
return _.map(resp.snapshots, 'snapshot');
}, function () {
return [];
})