bugfix: duration and sip_status display as numbers

This commit is contained in:
Dave Horton
2020-02-07 20:11:43 -05:00
parent f9c9aa8079
commit 1c9afcdf59
3 changed files with 20 additions and 6 deletions
+3 -2
View File
@@ -9,11 +9,12 @@ function snakeCase(obj) {
}
else if (typeof obj === 'object' && obj !== null) {
Object.keys(obj).forEach((key) => {
obj[snake(key)] = obj[key];
const value = obj[key];
delete obj[key];
obj[snake(key)] = value;
});
}
else if (typeof obj === 'string') {
else if (['string', 'number', 'boolean'].includes(typeof obj)) {
obj = snake(obj);
}
return obj;