UNPKG

ts-logs

Version:

This package provide a skd for audit and manager logs in nodejs and express

23 lines 648 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExtractBodyAsObject = void 0; const ExtractBodyAsObject = (body) => { try { if (body && typeof body === 'object' && !(body instanceof Date)) { return body; } if (Array.isArray(body)) { return body; } if (typeof body === 'string') { return JSON.parse(body); } return {}; } catch (error) { return {}; } }; exports.ExtractBodyAsObject = ExtractBodyAsObject; exports.default = exports.ExtractBodyAsObject; //# sourceMappingURL=extract-body.util.js.map