chore(commont) commont -> server/common: compatibility with old node

This commit is contained in:
coderaiser 2017-05-16 16:37:55 +03:00
parent ea297fc23e
commit c72c325417
6 changed files with 21 additions and 13 deletions

4
common/entity.js Normal file
View file

@ -0,0 +1,4 @@
'use strict';
module.exports = require('../server/common/entity');

View file

@ -1,13 +1,4 @@
'use strict';
module.exports = () => {
const data = {};
return (value) => {
if (typeof value !== 'undefined')
data.value = value;
return data.value;
};
};
module.exports = require('../server/common/store');

View file

@ -1,8 +1,8 @@
'use strict';
const rendy = require('rendy');
const Entity = require('./entity');
const store = require('../common/store');
const Entity = require('./common/entity');
const store = require('./common/store');
/* КОНСТАНТЫ (общие для клиента и сервера)*/

13
server/common/store.js Normal file
View file

@ -0,0 +1,13 @@
'use strict';
module.exports = () => {
const data = {};
return (value) => {
if (typeof value !== 'undefined')
data.value = value;
return data.value;
};
};

View file

@ -1,7 +1,7 @@
'use strict';
const test = require('tape');
const entity = require('../../server/entity');
const entity = require('../../common/entity');
test('cloudcmd: entity: encode', (t) => {
const result = entity.encode('<hello> ');