UNPKG

@elsikora/nestjs-crud-automator

Version:

A library for automating the creation of CRUD operations in NestJS.

32 lines (29 loc) 885 B
'use strict'; /** * Formats unknown values safely for logs (avoids "[object Object]" and circular JSON issues). * @param {unknown} value - Value to format * @returns {string} String representation suitable for logs */ function FormatUnknownForLog(value) { if (typeof value === "string") { return value; } if (typeof value === "number" || typeof value === "boolean" || typeof value === "bigint") { return String(value); } if (value === null) { return "null"; } if (value === undefined) { return "undefined"; } try { const json = JSON.stringify(value); return json ?? Object.prototype.toString.call(value); } catch { return Object.prototype.toString.call(value); } } exports.FormatUnknownForLog = FormatUnknownForLog; //# sourceMappingURL=format-unknown-for-log.utility.js.map