Skip to content

Commit 3b6cd58

Browse files
committed
add support for more objects
1 parent e244200 commit 3b6cd58

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ const doc_base = `http://techdocs.broadcom.com/content/broadcom/techdocs/us/en/c
88
module.exports = {
99
categories: [
1010
'request',
11-
'workflow',
12-
'change-request',
11+
'relational-information',
12+
'problem-category',
13+
'workflow',
14+
'task',
15+
'change-request',
1316
],
1417
doc_base,
1518
};

src/util.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,25 @@
1-
const isRequest = category => category === 'request';
1+
const hasNoSuffix = category => {
2+
switch(category) {
3+
case 'request':
4+
case 'problem-category':
5+
case 'relational-information':
6+
return true;
7+
}
28

3-
const normalize = category => isRequest(category) ? 'request' : `${category}-objects`;
9+
return false;
10+
};
11+
12+
/**
13+
*
14+
* Deal with inconsistent naming conventions
15+
* in the URLS
16+
*/
17+
const normalize = category => {
18+
if (hasNoSuffix(category)) return category;
19+
20+
return `${category}-objects`;
21+
}
422

523
module.exports = {
6-
normalize,
24+
normalize,
725
}

0 commit comments

Comments
 (0)