ts-lambda-local-dev
Version:
typescript lambda local development server
24 lines • 776 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloneDeep = exports.flattenArraysInJSON = void 0;
function flattenArraysInJSON(json) {
const flattenedJson = json;
for (const [key, value] of Object.entries(json)) {
if (Array.isArray(value)) {
flattenedJson[key] = value.join(',');
}
else if (typeof value === 'object' && value !== null) {
flattenedJson[key] = flattenArraysInJSON(value);
}
else {
flattenedJson[key] = value;
}
}
return flattenedJson;
}
exports.flattenArraysInJSON = flattenArraysInJSON;
function cloneDeep(obj) {
return JSON.parse(JSON.stringify(obj));
}
exports.cloneDeep = cloneDeep;
//# sourceMappingURL=utils.js.map