import { readJsonBody } from '../utils/request.js';
export function parseBody(req) {
    return readJsonBody(req);
}
export function parseQuery(url) {
    const queryIndex = url.indexOf('?');
    if (queryIndex === -1)
        return {};
    const queryString = url.substring(queryIndex + 1);
    const params = new URLSearchParams(queryString);
    const result = {};
    for (const [key, value] of params) {
        result[key] = value;
    }
    return result;
}
//# sourceMappingURL=http.js.map