Skip to content

Commit fe467a6

Browse files
committed
address review: use nullish assignment and derive separator from char
1 parent e8b5058 commit fe467a6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/generators/metadata/utils/transformers.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const splitByOuterSeparator = str => {
3333
const pieces = [];
3434
let current = '';
3535
let depth = 0;
36-
let separator = ' | ';
36+
let separator;
3737

3838
for (const char of str) {
3939
if (char === '<') {
@@ -43,7 +43,7 @@ const splitByOuterSeparator = str => {
4343
} else if ((char === '|' || char === '&') && depth === 0) {
4444
pieces.push(current);
4545
current = '';
46-
separator = char === '&' ? ' & ' : ' | ';
46+
separator ??= ` ${char} `;
4747
continue;
4848
}
4949
current += char;

0 commit comments

Comments
 (0)