rename precision to decimals, add typeTags, continue refactoring

This commit is contained in:
bordun 2020-02-29 17:01:29 +01:00
parent f41ac14698
commit a58075c602
54 changed files with 426 additions and 256 deletions

View file

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