_.unique -> _.uniq && _.pluck -> _.map
This commit is contained in:
@ -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) {
|
||||
|
||||
2
test/fixtures/keepalive.js
vendored
2
test/fixtures/keepalive.js
vendored
@ -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();
|
||||
|
||||
@ -112,7 +112,7 @@ module.exports = {
|
||||
snapshot: '_all'
|
||||
})
|
||||
.then(function (resp) {
|
||||
return _.pluck(resp.snapshots, 'snapshot');
|
||||
return _.map(resp.snapshots, 'snapshot');
|
||||
}, function () {
|
||||
return [];
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user