mirror of
https://github.com/misskey-dev/SyslogPro.git
synced 2025-04-29 02:37:18 +09:00
skip showing data when the value of structured data is undefined
This commit is contained in:
parent
cde24f7681
commit
d6e33651ab
12
index.ts
12
index.ts
@ -1452,11 +1452,17 @@ export class RFC5424 extends RFC {
|
||||
return '[' + [
|
||||
sdId,
|
||||
...Object.entries(sdParam)
|
||||
.reduce((array, [name, value]) => [
|
||||
.reduce((array, [name, value]) => {
|
||||
if (typeof value === 'undefined') {
|
||||
return array;
|
||||
}
|
||||
|
||||
return [
|
||||
...array,
|
||||
...(Array.isArray(value) ? value : [value])
|
||||
.map((v) => `${name}="${RFC5424.escapeParamValue(v)}"`),
|
||||
], []),
|
||||
.map((v) => `${name}="${RFC5424.escapeParamValue(v || '')}"`),
|
||||
];
|
||||
}, []),
|
||||
].join(' ') + ']';
|
||||
}).join('');
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user