_.unique -> _.uniq && _.pluck -> _.map
This commit is contained in:
@ -88,7 +88,7 @@ module.exports = function (branch, done) {
|
|||||||
apiSpec = {
|
apiSpec = {
|
||||||
actions: groups.normal || [],
|
actions: groups.normal || [],
|
||||||
proxies: groups.proxies || [],
|
proxies: groups.proxies || [],
|
||||||
namespaces: _.unique(namespaces.sort(), true),
|
namespaces: _.uniq(namespaces.sort(), true),
|
||||||
clientActionModifier: overrides.clientActionModifier
|
clientActionModifier: overrides.clientActionModifier
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -252,8 +252,14 @@ module.exports = function (branch, done) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if (urlSignatures.length !== _.unique(urlSignatures).length) {
|
if (urlSignatures.length !== _.uniq(urlSignatures).length) {
|
||||||
throw new Error('Multiple URLS with the same signature detected for ' + spec.name + '\n' + _.pluck(urls, 'fmt').join('\n') + '\n');
|
throw new Error(
|
||||||
|
'Multiple URLS with the same signature detected for ' +
|
||||||
|
spec.name +
|
||||||
|
'\n' +
|
||||||
|
_.map(urls, 'fmt').join('\n') +
|
||||||
|
'\n'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urls.length > 1) {
|
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 = {
|
var out = {
|
||||||
socketCount: err || sockets.length,
|
socketCount: err || sockets.length,
|
||||||
remaining: _.where(sockets, { destroyed: true }).length - 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();
|
clock.restore();
|
||||||
|
|||||||
@ -112,7 +112,7 @@ module.exports = {
|
|||||||
snapshot: '_all'
|
snapshot: '_all'
|
||||||
})
|
})
|
||||||
.then(function (resp) {
|
.then(function (resp) {
|
||||||
return _.pluck(resp.snapshots, 'snapshot');
|
return _.map(resp.snapshots, 'snapshot');
|
||||||
}, function () {
|
}, function () {
|
||||||
return [];
|
return [];
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user