mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
chore(commont) commont -> server/common: compatibility with old node
This commit is contained in:
parent
ea297fc23e
commit
c72c325417
6 changed files with 21 additions and 13 deletions
4
common/entity.js
Normal file
4
common/entity.js
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = require('../server/common/entity');
|
||||
|
||||
|
|
@ -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');
|
||||
|
||||
|
|
|
|||
|
|
@ -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
13
server/common/store.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
module.exports = () => {
|
||||
const data = {};
|
||||
|
||||
return (value) => {
|
||||
if (typeof value !== 'undefined')
|
||||
data.value = value;
|
||||
|
||||
return data.value;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -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> ');
|
||||
Loading…
Add table
Add a link
Reference in a new issue