-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.js
More file actions
38 lines (35 loc) · 911 Bytes
/
constants.js
File metadata and controls
38 lines (35 loc) · 911 Bytes
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
33
34
35
36
37
38
let commandIndex = 0;
const constants = {
COMMAND: commandIndex++,
STATUS: commandIndex++,
DOCUMENT: commandIndex++,
DOCUMENTS: commandIndex++,
DATA: commandIndex++,
INFO: commandIndex++,
NOTIFY_ON: commandIndex++,
NOTIFY_OFF: commandIndex++,
LOCK: commandIndex++,
UNLOCK: commandIndex++,
COUNT: commandIndex++,
GET: commandIndex++,
POST: commandIndex++,
PUT: commandIndex++,
PATCH: commandIndex++,
DELETE: commandIndex++,
LOCK_ID: commandIndex++,
LOCK_STRATEGY: commandIndex++,
LOCK_STRATEGY_FAIL: commandIndex++,
LOCK_STRATEGY_WAIT: commandIndex++,
COLLECTION_ID: commandIndex++,
RESOURCE_ID: commandIndex++,
QUERY: commandIndex++,
FIELDS: commandIndex++,
LIMIT: commandIndex++,
ORDER: commandIndex++
};
if (process.env.NODE_ENV === 'development') {
Object.keys(constants).forEach(key => {
constants[key] = key;
});
}
module.exports = constants;