1 |
|
2 |
|
3 | exports.toString = function (klass) {
|
4 | switch (klass) {
|
5 | case 1: return 'IN'
|
6 | case 2: return 'CS'
|
7 | case 3: return 'CH'
|
8 | case 4: return 'HS'
|
9 | case 255: return 'ANY'
|
10 | }
|
11 | return 'UNKNOWN_' + klass
|
12 | }
|
13 |
|
14 | exports.toClass = function (name) {
|
15 | switch (name.toUpperCase()) {
|
16 | case 'IN': return 1
|
17 | case 'CS': return 2
|
18 | case 'CH': return 3
|
19 | case 'HS': return 4
|
20 | case 'ANY': return 255
|
21 | }
|
22 | return 0
|
23 | }
|