import { HttpStatusCodes } from "./httpStatusCodes.mjs";

//#region src/utils/responseData.ts
const isSuccessStatus = (status) => status === HttpStatusCodes.OK_200 || status === HttpStatusCodes.CREATED_201 || status === HttpStatusCodes.ACCEPTED_202 || status === HttpStatusCodes.NON_AUTHORITATIVE_INFORMATION_203 || status === HttpStatusCodes.NO_CONTENT_204 || status === HttpStatusCodes.RESET_CONTENT_205 || status === HttpStatusCodes.PARTIAL_CONTENT_206 || status === HttpStatusCodes.MULTI_STATUS_207 || status === HttpStatusCodes.ALREADY_REPORTED_208 || status === HttpStatusCodes.IM_USED_226;
function formatResponse({ message, description, data, error, status = HttpStatusCodes.OK_200 }) {
	return {
		success: isSuccessStatus(status),
		message: message ?? void 0,
		description: description ?? void 0,
		data: data ?? null,
		error: error ?? void 0,
		status
	};
}
function formatPaginatedResponse({ status = HttpStatusCodes.OK_200, message, description, data, error, page, pageSize, totalPages, totalItems }) {
	return {
		success: isSuccessStatus(status),
		message: message ?? void 0,
		description: description ?? void 0,
		data: data ?? null,
		error: error ?? void 0,
		status,
		page: page ?? null,
		page_size: pageSize ?? null,
		total_pages: totalPages ?? null,
		total_items: totalItems ?? null
	};
}

//#endregion
export { formatPaginatedResponse, formatResponse };
//# sourceMappingURL=responseData.mjs.map