1 | function EntitiesMapper() {
|
2 |
|
3 | }
|
4 |
|
5 | EntitiesMapper.toServerMethod = function (method) {
|
6 | var serverMethod = {
|
7 | uniqueId: method.uniqueId,
|
8 | displayName: method.srcData.displayName,
|
9 | position: method.srcData.position,
|
10 | endPosition: method.srcData.endPosition,
|
11 | hash: method.srcData.hash,
|
12 | sigHash: method.srcData.sigHash,
|
13 | meta: method.meta
|
14 | };
|
15 |
|
16 | return serverMethod;
|
17 | }
|
18 |
|
19 | EntitiesMapper.toServerBranch = function (branch) {
|
20 | var serverBranch = {
|
21 | uniqueId: branch.uniqueId,
|
22 | filename: branch.srcData.relativeFilename,
|
23 | type: branch.type,
|
24 | position: branch.srcData.position,
|
25 | endPosition: branch.srcData.endPosition,
|
26 | hash: branch.srcData.hash,
|
27 | index: branch.index,
|
28 | parentPosition: branch.srcData.parentPosition
|
29 | }
|
30 |
|
31 | return serverBranch;
|
32 | }
|
33 |
|
34 | module.exports = EntitiesMapper; |
\ | No newline at end of file |