UNPKG

bb-inspired

Version:

Core library for BB-inspired NestJS backend

39 lines 976 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApiResponse = void 0; class ApiResponse { static success(data, message, meta) { return { success: true, data, message, timestamp: new Date().toISOString(), meta, }; } static error(error, data, meta) { return { success: false, error, data, timestamp: new Date().toISOString(), meta, }; } static paginated(data, page, limit, total, message) { return { success: true, data, message, timestamp: new Date().toISOString(), meta: { page, limit, total, pages: Math.ceil(total / limit), }, }; } } exports.ApiResponse = ApiResponse; //# sourceMappingURL=response.dto.js.map