Minor fixes, comments

This commit is contained in:
2022-11-07 17:36:33 +05:30
parent 7e59afe469
commit 1973247ae4
9 changed files with 46 additions and 15 deletions

View File

@@ -1,4 +1,11 @@
function getNestedValuesString(obj) {
/**
* String joins all the values of a JSON object, including nested keys
*
* @param {any} obj JSON object
* @param {string} delimiter Delimiter of final string
* @returns
*/
const getNestedValuesString = (obj, delimiter) => {
let values = [];
for (key in obj) {
if (typeof obj[key] !== "object") {
@@ -8,7 +15,7 @@ function getNestedValuesString(obj) {
}
}
return values.join();
return delimiter ? values.join(delimiter) : values.join();
}
module.exports = {

View File

@@ -1,3 +1,5 @@
// Whole thing is winston logger stuff, if you want to learn read the docs
const path = require("path");
const { createLogger, transports, config, format } = require("winston");