"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bsonMiddleware=bsonMiddleware;const utils_1=require("../../utils");async function bsonMiddleware(e,t){e.req.requestOptions?.content&&(e.req.requestOptions.content=utils_1.MongoSerializer.serialize(e.req.requestOptions.content)),await t(),e.result?.status===200&&e.result.data&&(e.result.data=utils_1.MongoSerializer.deserialize(e.result.data))}