-
Notifications
You must be signed in to change notification settings - Fork 0
/
syncInfo.js
49 lines (45 loc) · 1.22 KB
/
syncInfo.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var extend = require('util')._extend;
var SyncInfo = function (options) {
// we don't want anyone outside to be able to mess with the internal
// state. Therefore we copy over the properties to an internal object
var _options = extend({ count: 0, data: null }, options);
Object.defineProperties(this, {
target: {
get : function(){
return _options.target;
},
enumerable: true
},
taskId: {
get : function(){
return _options.taskId;
},
enumerable: true
},
empty: {
get : function(){
return _options.count === 0;
},
enumerable: true
},
count: {
get : function(){
return _options.count;
},
set: function(count){
_options.count = count;
},
enumerable: true
},
data: {
get : function(){
return _options.data;
},
set: function(data){
_options.data = data;
},
enumerable: true
}
});
};
module.exports = SyncInfo;