"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function getParams(req) {
    if ((req === null || req === void 0 ? void 0 : req.method) == "POST") {
        return new Proxy({}, {
            get: function (_, key) {
                var _a;
                return (_a = req.body) === null || _a === void 0 ? void 0 : _a[key];
            },
        });
        /*
        // Disabled, since this could lead to a sneaky click on a link attack.
        // Should only be enabled for dev purposes.
        } else if (req?.method == "GET") {
        return new Proxy(
          {},
          {
            get(_, key) {
              if (typeof key != "string") {
                return undefined;
              }
              return req.query?.[key];
            },
          }
        );
    */
    }
    else {
        // only support params for POST requests.
        return {};
    }
}
exports.default = getParams;
//# sourceMappingURL=get-params.js.map