Files
DRB-CnC/Server/utils.js
Logan Cusano 4e1b82c557 Init WIP Bot
2022-12-11 06:09:25 -05:00

9 lines
270 B
JavaScript

// Convert a JSON object to a buffer for the DB
exports.JsonToBuffer = (jsonObject) => {
return Buffer.from(JSON.stringify(jsonObject))
}
// Convert a buffer from the DB to JSON object
exports.BufferToJson = (buffer) => {
return JSON.parse(buffer.toString());
}