forked from haraka/Haraka
-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.js
32 lines (29 loc) · 813 Bytes
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
// Constants
exports.cont = 900;
exports.stop = 901;
exports.deny = 902;
exports.denysoft = 903;
exports.denydisconnect = 904;
exports.disconnect = 905;
exports.ok = 906;
exports.next_hook = 907;
exports.delay = 908;
exports.denysoftdisconnect = 909;
exports.import = function (object) {
for (var k in exports) {
if (exports.hasOwnProperty(k) && k !== "import") {
object[k.toUpperCase()] = exports[k];
}
}
}
exports.translate = function (value) {
var t = {};
for (var k in exports) {
if (typeof exports[k] === 'number') {
t[exports[k]] = k.toUpperCase();
}
}
if (t[value]) return t[value];
return 'UNKNOWN';
}