UNPKG

ts-lambda-local-dev

Version:
24 lines 776 B
"use strict"; 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