Major update

- Working client server interactions
- Can create radio config
- Needs radio testing
This commit is contained in:
Logan Cusano
2023-02-18 20:41:43 -05:00
parent c8c75e8b37
commit ce072d9287
25 changed files with 1114 additions and 39 deletions

View File

@@ -6,4 +6,14 @@ exports.JsonToBuffer = (jsonObject) => {
// Convert a buffer from the DB to JSON object
exports.BufferToJson = (buffer) => {
return JSON.parse(buffer.toString());
}
}
/** Find a key in an object by its value
*
* @param {*} object The object to search
* @param {*} value The value to search the arrays in the object for
* @returns The key of the object that contains the value
*/
exports.getKeyByArrayValue = (object, value) => {
return Object.keys(object).find(key => object[key].includes(value));
}