package: rename browser to client and main to server

This commit is contained in:
bordun 2018-10-28 15:06:11 +01:00
parent ea142198e0
commit e8b2a3fb99
123 changed files with 43 additions and 42 deletions

24
src/server/utils.js Normal file
View file

@ -0,0 +1,24 @@
module.exports = {
deepCopy: function(obj, precision) {
var copy = obj
if (obj === null) {
return obj
}
if (typeof obj === 'object') {
copy = Array.isArray(obj) ? [] : {}
for (let key in obj) {
copy[key] = module.exports.deepCopy(obj[key], precision)
}
} else if (typeof obj == 'number') {
return precision === undefined ? copy : parseFloat(copy.toFixed(precision))
}
return copy
}
}