{"version":3,"sources":["request-methods.ts"],"sourcesContent":["import { Context } from \"./context.ts\";\nimport { createFilter } from \"./route-filter.ts\";\n\nexport function contextMatchesRequestMethod(requestMethod:string, context: Context) {\n\treturn context.request?.method === requestMethod;\n}\n\nexport const RequestMethod = {\n\tPOST: \t\tcreateFilter(ctx => contextMatchesRequestMethod(\"POST\", ctx), \"POST Request\"),\n\tGET:  \t\tcreateFilter(ctx => contextMatchesRequestMethod(\"GET\", ctx), \"GET Request\"),\n\tPATCH: \t\tcreateFilter(ctx => contextMatchesRequestMethod(\"PATCH\", ctx), \"PATCH Request\"),\n\tDELETE: \tcreateFilter(ctx => contextMatchesRequestMethod(\"DELETE\", ctx), \"DELETE Request\"),\n\tPUT:  \t\tcreateFilter(ctx => contextMatchesRequestMethod(\"PUT\", ctx), \"PUT Request\"),\n\tOPTIONS:  \tcreateFilter(ctx => contextMatchesRequestMethod(\"OPTIONS\", ctx), \"OPTIONS Request\"),\n\tHEAD:  \t\tcreateFilter(ctx => contextMatchesRequestMethod(\"HEAD\", ctx), \"HEAD Request\"),\n} as const;\n\n\n\n"],"names":["createFilter","contextMatchesRequestMethod","requestMethod","context","request","method","RequestMethod","POST","ctx","GET","PATCH","DELETE","PUT","OPTIONS","HEAD"],"mappings":"AACA,SAASA,YAAY,QAAQ,oBAAoB;AAEjD,OAAO,SAASC,4BAA4BC,aAAoB,EAAEC,OAAgB;IACjF,OAAOA,QAAQC,OAAO,EAAEC,WAAWH;AACpC;AAEA,OAAO,MAAMI,gBAAgB;IAC5BC,MAAQP,aAAaQ,CAAAA,MAAOP,4BAA4B,QAAQO,MAAM;IACtEC,KAAQT,aAAaQ,CAAAA,MAAOP,4BAA4B,OAAOO,MAAM;IACrEE,OAASV,aAAaQ,CAAAA,MAAOP,4BAA4B,SAASO,MAAM;IACxEG,QAASX,aAAaQ,CAAAA,MAAOP,4BAA4B,UAAUO,MAAM;IACzEI,KAAQZ,aAAaQ,CAAAA,MAAOP,4BAA4B,OAAOO,MAAM;IACrEK,SAAWb,aAAaQ,CAAAA,MAAOP,4BAA4B,WAAWO,MAAM;IAC5EM,MAASd,aAAaQ,CAAAA,MAAOP,4BAA4B,QAAQO,MAAM;AACxE,EAAW","sourceRoot":"/lib/uix-0.4.22/src/routing/","file":"request-methods.ts"}