mirror of
https://github.com/jambonz/jambonz-api-server.git
synced 2026-07-24 13:02:16 +00:00
bugfix: duration and sip_status display as numbers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user