mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
#144 Add fallback support to previous config files
This commit is contained in:
parent
999abc5b73
commit
098675516b
1 changed files with 12 additions and 1 deletions
|
@ -13,7 +13,18 @@ module.exports.notify = function(metadata, config) {
|
||||||
body: content
|
body: content
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( config.notify.headers ) {
|
// provides fallback support, it's accept an Object {} and Array of {}
|
||||||
|
if ( config.notify.headers && Array.isArray(config.notify.headers) ) {
|
||||||
|
var header = {};
|
||||||
|
config.notify.headers.map(function(item) {
|
||||||
|
if (Object.is(item, item)) {
|
||||||
|
for (var key in item) {
|
||||||
|
header[key] = item[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
options.headers = header;
|
||||||
|
} else if (Object.is(config.notify.headers, config.notify.headers)) {
|
||||||
options.headers = config.notify.headers;
|
options.headers = config.notify.headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue