[{"data":1,"prerenderedAt":2197},["ShallowReactive",2],{"navigation_docs":3,"-rpc-server-json-round-trip":399},[4,162,346],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":24},"RPC","icon-park-outline:lightning","\u002Frpc","01.rpc",[10,25,63,77,102,136],{"title":11,"icon":12,"redirect":7,"path":13,"stem":14,"children":15,"page":24},"Introduction","icon-park-outline:home","\u002Frpc\u002Fintroduction","01.rpc\u002F01.introduction",[16,20],{"title":17,"path":18,"stem":19},"Quick Start","\u002Frpc\u002Fintroduction\u002Fquick-start","01.rpc\u002F01.introduction\u002F02.quick-start",{"title":21,"path":22,"stem":23},"Manual Install","\u002Frpc\u002Fintroduction\u002Fmanual-install","01.rpc\u002F01.introduction\u002F03.manual-install",false,{"title":26,"icon":27,"path":28,"stem":29,"children":30,"page":24},"Server","icon-park-outline:server","\u002Frpc\u002Fserver","01.rpc\u002F02.server",[31,35,39,43,47,51,55,59],{"title":32,"path":33,"stem":34},"Routes","\u002Frpc\u002Fserver\u002Froutes","01.rpc\u002F02.server\u002F01.routes",{"title":36,"path":37,"stem":38},"Middleware","\u002Frpc\u002Fserver\u002Fmiddleware","01.rpc\u002F02.server\u002F02.middleware",{"title":40,"path":41,"stem":42},"Call Context","\u002Frpc\u002Fserver\u002Fcall-context","01.rpc\u002F02.server\u002F03.call-context",{"title":44,"path":45,"stem":46},"Headers","\u002Frpc\u002Fserver\u002Fheaders","01.rpc\u002F02.server\u002F04.headers",{"title":48,"path":49,"stem":50},"Error Handling","\u002Frpc\u002Fserver\u002Ferror-handling","01.rpc\u002F02.server\u002F05.error-handling",{"title":52,"path":53,"stem":54},"Validation","\u002Frpc\u002Fserver\u002Fvalidation","01.rpc\u002F02.server\u002F06.validation",{"title":56,"path":57,"stem":58},"JSON Round Trip","\u002Frpc\u002Fserver\u002Fjson-round-trip","01.rpc\u002F02.server\u002F07.json-round-trip",{"title":60,"path":61,"stem":62},"Drizzle Tables","\u002Frpc\u002Fserver\u002Fdrizzle-tables","01.rpc\u002F02.server\u002F08.drizzle-tables",{"title":64,"icon":65,"path":66,"stem":67,"children":68,"page":24},"Middlewares","icon-park-outline:link-one","\u002Frpc\u002Fmiddlewares","01.rpc\u002F03.middlewares",[69,73],{"title":70,"path":71,"stem":72},"fetchMetadata","\u002Frpc\u002Fmiddlewares\u002Ffetch-metadata","01.rpc\u002F03.middlewares\u002F01.fetch-metadata",{"title":74,"path":75,"stem":76},"syncRoutes","\u002Frpc\u002Fmiddlewares\u002Fsync-routes","01.rpc\u002F03.middlewares\u002F02.sync-routes",{"title":78,"icon":79,"path":80,"stem":81,"children":82,"page":24},"Client","icon-park-outline:computer","\u002Frpc\u002Fclient","01.rpc\u002F04.client",[83,87,91,94,98],{"title":84,"path":85,"stem":86},"Client Overview","\u002Frpc\u002Fclient\u002Fclient-overview","01.rpc\u002F04.client\u002F00.client-overview",{"title":88,"path":89,"stem":90},"Client Middleware","\u002Frpc\u002Fclient\u002Fclient-middleware","01.rpc\u002F04.client\u002F01.client-middleware",{"title":48,"path":92,"stem":93},"\u002Frpc\u002Fclient\u002Ferror-handling","01.rpc\u002F04.client\u002F02.error-handling",{"title":95,"path":96,"stem":97},"Batch Requests","\u002Frpc\u002Fclient\u002Fbatch","01.rpc\u002F04.client\u002F03.batch",{"title":99,"path":100,"stem":101},"Cancellation & Timeouts","\u002Frpc\u002Fclient\u002Fcancellation-timeouts","01.rpc\u002F04.client\u002F04.cancellation-timeouts",{"title":103,"redirect":104,"icon":105,"path":106,"stem":107,"children":108,"page":24},"Platforms","\u002Frpc\u002Fplatforms\u002Fnode-js","icon-park-outline:play","\u002Frpc\u002Fplatforms","01.rpc\u002F06.platforms",[109,112,116,120,124,128,132],{"title":110,"path":104,"stem":111},"Node.js","01.rpc\u002F06.platforms\u002F01.node-js",{"title":113,"path":114,"stem":115},"Bun","\u002Frpc\u002Fplatforms\u002Fbun","01.rpc\u002F06.platforms\u002F02.bun",{"title":117,"path":118,"stem":119},"AWS Lambda","\u002Frpc\u002Fplatforms\u002Faws-lambda","01.rpc\u002F06.platforms\u002F03.aws-lambda",{"title":121,"path":122,"stem":123},"Google Cloud Functions","\u002Frpc\u002Fplatforms\u002Fgoogle-cloud-functions","01.rpc\u002F06.platforms\u002F04.google-cloud-functions",{"title":125,"path":126,"stem":127},"Cloudflare Workers","\u002Frpc\u002Fplatforms\u002Fcloudflare","01.rpc\u002F06.platforms\u002F05.cloudflare",{"title":129,"path":130,"stem":131},"Vercel","\u002Frpc\u002Fplatforms\u002Fvercel","01.rpc\u002F06.platforms\u002F06.vercel",{"title":133,"path":134,"stem":135},"uWebSockets.js","\u002Frpc\u002Fplatforms\u002Fuwebsockets","01.rpc\u002F06.platforms\u002F07.uwebsockets",{"title":137,"icon":138,"path":139,"stem":140,"children":141,"page":24},"Devtools","icon-park-outline:tool","\u002Frpc\u002Fdevtools","01.rpc\u002F07.devtools",[142,146,150,154,158],{"title":143,"path":144,"stem":145},"Linter","\u002Frpc\u002Fdevtools\u002Flinter","01.rpc\u002F07.devtools\u002F01.linter",{"title":147,"path":148,"stem":149},"Vite","\u002Frpc\u002Fdevtools\u002Fvite","01.rpc\u002F07.devtools\u002F02.vite",{"title":151,"path":152,"stem":153},"Next.js","\u002Frpc\u002Fdevtools\u002Fnextjs","01.rpc\u002F07.devtools\u002F03.nextjs",{"title":155,"path":156,"stem":157},"CLI","\u002Frpc\u002Fdevtools\u002Fcli","01.rpc\u002F07.devtools\u002F04.cli",{"title":159,"path":160,"stem":161},"API Types","\u002Frpc\u002Fdevtools\u002Fapi-types","01.rpc\u002F07.devtools\u002F05.api-types",{"title":163,"icon":164,"path":165,"stem":166,"children":167,"page":24},"RunTypes","i-lucide-braces","\u002Fruntypes","02.runtypes",[168,184,224,254,268,290,332],{"title":11,"icon":169,"redirect":165,"path":170,"stem":171,"children":172,"page":24},"i-lucide-rocket","\u002Fruntypes\u002Fintroduction","02.runtypes\u002F01.introduction",[173,177,180],{"title":174,"path":175,"stem":176},"Built on typescript-go","\u002Fruntypes\u002Fintroduction\u002Fbuilt-on-typescript-go","02.runtypes\u002F01.introduction\u002F02.built-on-typescript-go",{"title":17,"path":178,"stem":179},"\u002Fruntypes\u002Fintroduction\u002Fquick-start","02.runtypes\u002F01.introduction\u002F03.quick-start",{"title":181,"path":182,"stem":183},"Configuration","\u002Fruntypes\u002Fintroduction\u002Fconfiguration","02.runtypes\u002F01.introduction\u002F04.configuration",{"title":185,"icon":186,"redirect":187,"path":188,"stem":189,"children":190,"page":24},"Guide","i-lucide-book-open","\u002Fruntypes\u002Fguide\u002Ftype-builders","\u002Fruntypes\u002Fguide","02.runtypes\u002F02.guide",[191,194,198,201,204,208,212,216,220],{"title":192,"path":187,"stem":193},"Types vs Type Builders","02.runtypes\u002F02.guide\u002F01.type-builders",{"title":195,"path":196,"stem":197},"Reflection","\u002Fruntypes\u002Fguide\u002Freflection","02.runtypes\u002F02.guide\u002F02.reflection",{"title":52,"path":199,"stem":200},"\u002Fruntypes\u002Fguide\u002Fvalidation","02.runtypes\u002F02.guide\u002F03.validation",{"title":56,"path":202,"stem":203},"\u002Fruntypes\u002Fguide\u002Fjson-round-trip","02.runtypes\u002F02.guide\u002F04.json-round-trip",{"title":205,"path":206,"stem":207},"Data Mocking","\u002Fruntypes\u002Fguide\u002Fmocking","02.runtypes\u002F02.guide\u002F07.mocking",{"title":209,"path":210,"stem":211},"JSON Schemas","\u002Fruntypes\u002Fguide\u002Fjson-schemas","02.runtypes\u002F02.guide\u002F08.json-schemas",{"title":213,"path":214,"stem":215},"Pure Functions","\u002Fruntypes\u002Fguide\u002Fpure-functions","02.runtypes\u002F02.guide\u002F09.pure-functions",{"title":217,"path":218,"stem":219},"Compiler Markers","\u002Fruntypes\u002Fguide\u002Fcompiler-markers","02.runtypes\u002F02.guide\u002F10.compiler-markers",{"title":221,"path":222,"stem":223},"All Compiled Functions","\u002Fruntypes\u002Fguide\u002Fall-compiled-functions","02.runtypes\u002F02.guide\u002F11.all-compiled-functions",{"title":225,"icon":226,"redirect":227,"path":228,"stem":229,"children":230,"page":24},"Type Formats","i-lucide-shapes","\u002Fruntypes\u002Ftype-formats\u002Foverview","\u002Fruntypes\u002Ftype-formats","02.runtypes\u002F03.type-formats",[231,234,238,242,246,250],{"title":232,"path":227,"stem":233},"Overview","02.runtypes\u002F03.type-formats\u002F01.overview",{"title":235,"path":236,"stem":237},"String Formats","\u002Fruntypes\u002Ftype-formats\u002Fstring","02.runtypes\u002F03.type-formats\u002F02.string",{"title":239,"path":240,"stem":241},"Number Formats","\u002Fruntypes\u002Ftype-formats\u002Fnumber","02.runtypes\u002F03.type-formats\u002F03.number",{"title":243,"path":244,"stem":245},"BigInt Formats","\u002Fruntypes\u002Ftype-formats\u002Fbigint","02.runtypes\u002F03.type-formats\u002F04.bigint",{"title":247,"path":248,"stem":249},"Date and Time Formats","\u002Fruntypes\u002Ftype-formats\u002Fdate-time","02.runtypes\u002F03.type-formats\u002F05.date-time",{"title":251,"path":252,"stem":253},"Collection Formats","\u002Fruntypes\u002Ftype-formats\u002Fcollections","02.runtypes\u002F03.type-formats\u002F06.collections",{"title":255,"icon":256,"redirect":257,"path":258,"stem":259,"children":260,"page":24},"Tooling","i-lucide-wrench","\u002Fruntypes\u002Ftooling\u002Flinting","\u002Fruntypes\u002Ftooling","02.runtypes\u002F04.tooling",[261,264],{"title":262,"path":257,"stem":263},"Linting","02.runtypes\u002F04.tooling\u002F01.linting",{"title":265,"path":266,"stem":267},"Source Conversion","\u002Fruntypes\u002Ftooling\u002Fsource-conversion","02.runtypes\u002F04.tooling\u002F02.source-conversion",{"title":269,"icon":270,"redirect":271,"path":272,"stem":273,"children":274,"page":24},"AI Integration","i-lucide-sparkles","\u002Fruntypes\u002Fai-integration\u002Fworkflow-and-commands","\u002Fruntypes\u002Fai-integration","02.runtypes\u002F05.ai-integration",[275,278,282,286],{"title":276,"path":271,"stem":277},"AI Workflow","02.runtypes\u002F05.ai-integration\u002F01.workflow-and-commands",{"title":279,"path":280,"stem":281},"FriendlyText","\u002Fruntypes\u002Fai-integration\u002Ffriendly-text","02.runtypes\u002F05.ai-integration\u002F02.friendly-text",{"title":283,"path":284,"stem":285},"MockData","\u002Fruntypes\u002Fai-integration\u002Fmock-data","02.runtypes\u002F05.ai-integration\u002F03.mock-data",{"title":287,"path":288,"stem":289},"Translations (i18n)","\u002Fruntypes\u002Fai-integration\u002Fi18n","02.runtypes\u002F05.ai-integration\u002F04.i18n",{"title":291,"icon":292,"redirect":293,"path":294,"stem":295,"children":296,"page":24},"Drizzle ORM","i-lineicons-drizzle","\u002Fruntypes\u002Fdrizzle-orm\u002Fdrizzle-overview","\u002Fruntypes\u002Fdrizzle-orm","02.runtypes\u002F06.drizzle-orm",[297,300,304,308,312,316,320,324,328],{"title":298,"path":293,"stem":299},"Drizzle Overview","02.runtypes\u002F06.drizzle-orm\u002F00.drizzle-overview",{"title":301,"path":302,"stem":303},"Column Formats","\u002Fruntypes\u002Fdrizzle-orm\u002Fcolumn-formats","02.runtypes\u002F06.drizzle-orm\u002F01.column-formats",{"title":305,"path":306,"stem":307},"Views","\u002Fruntypes\u002Fdrizzle-orm\u002Fviews","02.runtypes\u002F06.drizzle-orm\u002F02.views",{"title":309,"path":310,"stem":311},"Indexes and Constraints","\u002Fruntypes\u002Fdrizzle-orm\u002Fconstraints","02.runtypes\u002F06.drizzle-orm\u002F03.constraints",{"title":313,"path":314,"stem":315},"Row Level Security","\u002Fruntypes\u002Fdrizzle-orm\u002Frow-level-security","02.runtypes\u002F06.drizzle-orm\u002F04.row-level-security",{"title":317,"path":318,"stem":319},"Relations","\u002Fruntypes\u002Fdrizzle-orm\u002Frelations","02.runtypes\u002F06.drizzle-orm\u002F05.relations",{"title":321,"path":322,"stem":323},"The Schema File","\u002Fruntypes\u002Fdrizzle-orm\u002Fschema-file","02.runtypes\u002F06.drizzle-orm\u002F06.schema-file",{"title":325,"path":326,"stem":327},"Migrate an Existing Schema","\u002Fruntypes\u002Fdrizzle-orm\u002Fmigrate-an-existing-schema","02.runtypes\u002F06.drizzle-orm\u002F07.migrate-an-existing-schema",{"title":329,"path":330,"stem":331},"Cloudflare D1 and Durable Objects","\u002Fruntypes\u002Fdrizzle-orm\u002Fcloudflare-storage","02.runtypes\u002F06.drizzle-orm\u002F08.cloudflare-storage",{"title":333,"icon":334,"redirect":335,"path":336,"stem":337,"children":338,"page":24},"Diagnostics","i-lucide-triangle-alert","\u002Fruntypes\u002Fdiagnostics\u002Ferror-levels","\u002Fruntypes\u002Fdiagnostics","02.runtypes\u002F08.diagnostics",[339,342],{"title":340,"path":335,"stem":341},"Error Levels","02.runtypes\u002F08.diagnostics\u002F01.error-levels",{"title":343,"path":344,"stem":345},"All Diagnostics","\u002Fruntypes\u002Fdiagnostics\u002Fall-diagnostics","02.runtypes\u002F08.diagnostics\u002F02.all-diagnostics",{"title":347,"icon":348,"path":349,"stem":350,"children":351,"page":24},"Benchmarks","i-lucide-gauge","\u002Fbenchmarks","03.benchmarks",[352,372],{"title":5,"icon":6,"redirect":353,"path":354,"stem":355,"children":356,"page":24},"\u002Fbenchmarks\u002Frpc\u002Fhello-world","\u002Fbenchmarks\u002Frpc","03.benchmarks\u002F02.rpc",[357,360,364,368],{"title":358,"path":353,"stem":359},"Hello World","03.benchmarks\u002F02.rpc\u002F01.hello-world",{"title":361,"path":362,"stem":363},"Light Validation","\u002Fbenchmarks\u002Frpc\u002Flight-validation","03.benchmarks\u002F02.rpc\u002F02.light-validation",{"title":365,"path":366,"stem":367},"Heavy Validation","\u002Fbenchmarks\u002Frpc\u002Fheavy-validation","03.benchmarks\u002F02.rpc\u002F03.heavy-validation",{"title":369,"path":370,"stem":371},"Payload Sizes","\u002Fbenchmarks\u002Frpc\u002Fpayload-sizes","03.benchmarks\u002F02.rpc\u002F04.payload-sizes",{"title":163,"icon":164,"redirect":373,"path":374,"stem":375,"children":376,"page":24},"\u002Fbenchmarks\u002Fruntypes\u002Fis-valid","\u002Fbenchmarks\u002Fruntypes","03.benchmarks\u002F03.runtypes",[377,380,384,388,392,395],{"title":378,"path":373,"stem":379},"Is Valid","03.benchmarks\u002F03.runtypes\u002F01.is-valid",{"title":381,"path":382,"stem":383},"Is Valid Formats","\u002Fbenchmarks\u002Fruntypes\u002Fis-valid-formats","03.benchmarks\u002F03.runtypes\u002F02.is-valid-formats",{"title":385,"path":386,"stem":387},"Get Errors","\u002Fbenchmarks\u002Fruntypes\u002Fget-errors","03.benchmarks\u002F03.runtypes\u002F03.get-errors",{"title":389,"path":390,"stem":391},"Get Errors Formats","\u002Fbenchmarks\u002Fruntypes\u002Fget-errors-formats","03.benchmarks\u002F03.runtypes\u002F04.get-errors-formats",{"title":56,"path":393,"stem":394},"\u002Fbenchmarks\u002Fruntypes\u002Fjson-round-trip","03.benchmarks\u002F03.runtypes\u002F05.json-round-trip",{"title":396,"path":397,"stem":398},"Type Checking","\u002Fbenchmarks\u002Fruntypes\u002Ftype-checking","03.benchmarks\u002F03.runtypes\u002F07.type-checking",{"id":400,"title":56,"body":401,"description":2191,"extension":2192,"links":2193,"meta":2194,"navigation":469,"path":57,"seo":2195,"stem":58,"__hash__":2196},"docs\u002F01.rpc\u002F02.server\u002F07.json-round-trip.md",{"type":402,"value":403},"minimark",[404,413,816,821,828,1065,1165,1171,1184,1188,1197,1260,1264,1269,1422,1428,1432,1440,2094,2107,2111,2120,2124,2140,2187],[405,406,407,408,412],"p",{},"mion runs the JSON round trip with ",[409,410,411],"code",{},"@mionjs\u002Frun-types",".\nYou work with native types (Dates, BigInts, Sets, Maps and more) and mion converts them on both ends, with no extra configuration.",[414,415,420],"pre",{"className":416,"code":417,"language":418,"meta":419,"style":419},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import {createMionRouter, Routes} from '@mionjs\u002Frouter';\n\nconst mion = createMionRouter();\n\n\u002F\u002F Your TypeScript types ARE the validation schema\ninterface User {\n  id: string;\n  email: string;\n  age: number;\n  birthDate: Date;\n  tags: Set\u003Cstring>;\n}\n\ntype NewUser = Omit\u003CUser, 'id'>;\n\nconst routes = {\n  createUser: mion.route((ctx, user: NewUser): User => {\n    \u002F\u002F Date and Set were restored from JSON, then user was validated\n    console.log(user.birthDate instanceof Date); \u002F\u002F true\n    console.log(user.tags instanceof Set); \u002F\u002F true\n    return {id: 'USER-123', ...user};\n  }),\n} satisfies Routes;\n","ts","",[409,421,422,464,471,493,498,505,518,533,545,558,571,591,597,602,633,638,650,695,701,736,764,793,804],{"__ignoreMap":419},[423,424,427,431,435,439,442,445,448,451,454,458,461],"span",{"class":425,"line":426},"line",1,[423,428,430],{"class":429},"s7zQu","import",[423,432,434],{"class":433},"sMK4o"," {",[423,436,438],{"class":437},"sTEyZ","createMionRouter",[423,440,441],{"class":433},",",[423,443,444],{"class":437}," Routes",[423,446,447],{"class":433},"}",[423,449,450],{"class":429}," from",[423,452,453],{"class":433}," '",[423,455,457],{"class":456},"sfazB","@mionjs\u002Frouter",[423,459,460],{"class":433},"'",[423,462,463],{"class":433},";\n",[423,465,467],{"class":425,"line":466},2,[423,468,470],{"emptyLinePlaceholder":469},true,"\n",[423,472,474,478,481,484,488,491],{"class":425,"line":473},3,[423,475,477],{"class":476},"spNyl","const",[423,479,480],{"class":437}," mion ",[423,482,483],{"class":433},"=",[423,485,487],{"class":486},"s2Zo4"," createMionRouter",[423,489,490],{"class":437},"()",[423,492,463],{"class":433},[423,494,496],{"class":425,"line":495},4,[423,497,470],{"emptyLinePlaceholder":469},[423,499,501],{"class":425,"line":500},5,[423,502,504],{"class":503},"sHwdD","\u002F\u002F Your TypeScript types ARE the validation schema\n",[423,506,508,511,515],{"class":425,"line":507},6,[423,509,510],{"class":476},"interface",[423,512,514],{"class":513},"sBMFI"," User",[423,516,517],{"class":433}," {\n",[423,519,521,525,528,531],{"class":425,"line":520},7,[423,522,524],{"class":523},"swJcz","  id",[423,526,527],{"class":433},":",[423,529,530],{"class":513}," string",[423,532,463],{"class":433},[423,534,536,539,541,543],{"class":425,"line":535},8,[423,537,538],{"class":523},"  email",[423,540,527],{"class":433},[423,542,530],{"class":513},[423,544,463],{"class":433},[423,546,548,551,553,556],{"class":425,"line":547},9,[423,549,550],{"class":523},"  age",[423,552,527],{"class":433},[423,554,555],{"class":513}," number",[423,557,463],{"class":433},[423,559,561,564,566,569],{"class":425,"line":560},10,[423,562,563],{"class":523},"  birthDate",[423,565,527],{"class":433},[423,567,568],{"class":513}," Date",[423,570,463],{"class":433},[423,572,574,577,579,582,585,588],{"class":425,"line":573},11,[423,575,576],{"class":523},"  tags",[423,578,527],{"class":433},[423,580,581],{"class":513}," Set",[423,583,584],{"class":433},"\u003C",[423,586,587],{"class":513},"string",[423,589,590],{"class":433},">;\n",[423,592,594],{"class":425,"line":593},12,[423,595,596],{"class":433},"}\n",[423,598,600],{"class":425,"line":599},13,[423,601,470],{"emptyLinePlaceholder":469},[423,603,605,608,611,614,617,619,622,624,626,629,631],{"class":425,"line":604},14,[423,606,607],{"class":476},"type",[423,609,610],{"class":513}," NewUser",[423,612,613],{"class":433}," =",[423,615,616],{"class":513}," Omit",[423,618,584],{"class":433},[423,620,621],{"class":513},"User",[423,623,441],{"class":433},[423,625,453],{"class":433},[423,627,628],{"class":456},"id",[423,630,460],{"class":433},[423,632,590],{"class":433},[423,634,636],{"class":425,"line":635},15,[423,637,470],{"emptyLinePlaceholder":469},[423,639,641,643,646,648],{"class":425,"line":640},16,[423,642,477],{"class":476},[423,644,645],{"class":437}," routes ",[423,647,483],{"class":433},[423,649,517],{"class":433},[423,651,653,656,658,661,664,667,670,672,676,678,681,683,685,688,690,693],{"class":425,"line":652},17,[423,654,655],{"class":523},"  createUser",[423,657,527],{"class":433},[423,659,660],{"class":437}," mion",[423,662,663],{"class":433},".",[423,665,666],{"class":486},"route",[423,668,669],{"class":437},"(",[423,671,669],{"class":433},[423,673,675],{"class":674},"sHdIc","ctx",[423,677,441],{"class":433},[423,679,680],{"class":674}," user",[423,682,527],{"class":433},[423,684,610],{"class":513},[423,686,687],{"class":433},"):",[423,689,514],{"class":513},[423,691,692],{"class":476}," =>",[423,694,517],{"class":433},[423,696,698],{"class":425,"line":697},18,[423,699,700],{"class":503},"    \u002F\u002F Date and Set were restored from JSON, then user was validated\n",[423,702,704,707,709,712,714,717,719,722,725,727,730,733],{"class":425,"line":703},19,[423,705,706],{"class":437},"    console",[423,708,663],{"class":433},[423,710,711],{"class":486},"log",[423,713,669],{"class":523},[423,715,716],{"class":437},"user",[423,718,663],{"class":433},[423,720,721],{"class":437},"birthDate",[423,723,724],{"class":433}," instanceof",[423,726,568],{"class":513},[423,728,729],{"class":523},")",[423,731,732],{"class":433},";",[423,734,735],{"class":503}," \u002F\u002F true\n",[423,737,739,741,743,745,747,749,751,754,756,758,760,762],{"class":425,"line":738},20,[423,740,706],{"class":437},[423,742,663],{"class":433},[423,744,711],{"class":486},[423,746,669],{"class":523},[423,748,716],{"class":437},[423,750,663],{"class":433},[423,752,753],{"class":437},"tags",[423,755,724],{"class":433},[423,757,581],{"class":513},[423,759,729],{"class":523},[423,761,732],{"class":433},[423,763,735],{"class":503},[423,765,767,770,772,774,776,778,781,783,785,788,790],{"class":425,"line":766},21,[423,768,769],{"class":429},"    return",[423,771,434],{"class":433},[423,773,628],{"class":523},[423,775,527],{"class":433},[423,777,453],{"class":433},[423,779,780],{"class":456},"USER-123",[423,782,460],{"class":433},[423,784,441],{"class":433},[423,786,787],{"class":433}," ...",[423,789,716],{"class":437},[423,791,792],{"class":433},"};\n",[423,794,796,799,801],{"class":425,"line":795},22,[423,797,798],{"class":433},"  }",[423,800,729],{"class":437},[423,802,803],{"class":433},",\n",[423,805,807,809,812,814],{"class":425,"line":806},23,[423,808,447],{"class":433},[423,810,811],{"class":429}," satisfies",[423,813,444],{"class":513},[423,815,463],{"class":433},[817,818,820],"h2",{"id":819},"parser-strategies","Parser Strategies",[405,822,823,824,827],{},"Every route has two wires: the params (the client encodes, the server decodes) and the return value (the server encodes, the client decodes). The ",[409,825,826],{},"parser"," option picks a strategy for each one.",[414,829,831],{"className":416,"code":830,"language":418,"meta":419,"style":419},"import {createMionRouter} from '@mionjs\u002Frouter';\n\n\u002F\u002F no parser option: `clone` on both directions, so only what the types declare reaches the wire\nexport const defaultMion = createMionRouter({basePath: 'api'});\n\n\u002F\u002F one strategy for both directions\nexport const compactMion = createMionRouter({parser: 'compact'});\n\n\u002F\u002F or one strategy per direction\nexport const mixedMion = createMionRouter({\n  parser: {params: 'compact', return: 'mutate'},\n});\n\n\u002F\u002F mutateStrict refuses a request carrying a property the params types do not declare\nexport const strictMion = createMionRouter({parser: {params: 'mutateStrict'}});\n",[409,832,833,853,857,862,900,904,909,943,947,952,970,1007,1015,1019,1024],{"__ignoreMap":419},[423,834,835,837,839,841,843,845,847,849,851],{"class":425,"line":426},[423,836,430],{"class":429},[423,838,434],{"class":433},[423,840,438],{"class":437},[423,842,447],{"class":433},[423,844,450],{"class":429},[423,846,453],{"class":433},[423,848,457],{"class":456},[423,850,460],{"class":433},[423,852,463],{"class":433},[423,854,855],{"class":425,"line":466},[423,856,470],{"emptyLinePlaceholder":469},[423,858,859],{"class":425,"line":473},[423,860,861],{"class":503},"\u002F\u002F no parser option: `clone` on both directions, so only what the types declare reaches the wire\n",[423,863,864,867,870,873,875,877,879,882,885,887,889,892,894,896,898],{"class":425,"line":495},[423,865,866],{"class":429},"export",[423,868,869],{"class":476}," const",[423,871,872],{"class":437}," defaultMion ",[423,874,483],{"class":433},[423,876,487],{"class":486},[423,878,669],{"class":437},[423,880,881],{"class":433},"{",[423,883,884],{"class":523},"basePath",[423,886,527],{"class":433},[423,888,453],{"class":433},[423,890,891],{"class":456},"api",[423,893,460],{"class":433},[423,895,447],{"class":433},[423,897,729],{"class":437},[423,899,463],{"class":433},[423,901,902],{"class":425,"line":500},[423,903,470],{"emptyLinePlaceholder":469},[423,905,906],{"class":425,"line":507},[423,907,908],{"class":503},"\u002F\u002F one strategy for both directions\n",[423,910,911,913,915,918,920,922,924,926,928,930,932,935,937,939,941],{"class":425,"line":520},[423,912,866],{"class":429},[423,914,869],{"class":476},[423,916,917],{"class":437}," compactMion ",[423,919,483],{"class":433},[423,921,487],{"class":486},[423,923,669],{"class":437},[423,925,881],{"class":433},[423,927,826],{"class":523},[423,929,527],{"class":433},[423,931,453],{"class":433},[423,933,934],{"class":456},"compact",[423,936,460],{"class":433},[423,938,447],{"class":433},[423,940,729],{"class":437},[423,942,463],{"class":433},[423,944,945],{"class":425,"line":535},[423,946,470],{"emptyLinePlaceholder":469},[423,948,949],{"class":425,"line":547},[423,950,951],{"class":503},"\u002F\u002F or one strategy per direction\n",[423,953,954,956,958,961,963,965,967],{"class":425,"line":560},[423,955,866],{"class":429},[423,957,869],{"class":476},[423,959,960],{"class":437}," mixedMion ",[423,962,483],{"class":433},[423,964,487],{"class":486},[423,966,669],{"class":437},[423,968,969],{"class":433},"{\n",[423,971,972,975,977,979,982,984,986,988,990,992,995,997,999,1002,1004],{"class":425,"line":573},[423,973,974],{"class":523},"  parser",[423,976,527],{"class":433},[423,978,434],{"class":433},[423,980,981],{"class":523},"params",[423,983,527],{"class":433},[423,985,453],{"class":433},[423,987,934],{"class":456},[423,989,460],{"class":433},[423,991,441],{"class":433},[423,993,994],{"class":523}," return",[423,996,527],{"class":433},[423,998,453],{"class":433},[423,1000,1001],{"class":456},"mutate",[423,1003,460],{"class":433},[423,1005,1006],{"class":433},"},\n",[423,1008,1009,1011,1013],{"class":425,"line":593},[423,1010,447],{"class":433},[423,1012,729],{"class":437},[423,1014,463],{"class":433},[423,1016,1017],{"class":425,"line":599},[423,1018,470],{"emptyLinePlaceholder":469},[423,1020,1021],{"class":425,"line":604},[423,1022,1023],{"class":503},"\u002F\u002F mutateStrict refuses a request carrying a property the params types do not declare\n",[423,1025,1026,1028,1030,1033,1035,1037,1039,1041,1043,1045,1047,1049,1051,1053,1056,1058,1061,1063],{"class":425,"line":635},[423,1027,866],{"class":429},[423,1029,869],{"class":476},[423,1031,1032],{"class":437}," strictMion ",[423,1034,483],{"class":433},[423,1036,487],{"class":486},[423,1038,669],{"class":437},[423,1040,881],{"class":433},[423,1042,826],{"class":523},[423,1044,527],{"class":433},[423,1046,434],{"class":433},[423,1048,981],{"class":523},[423,1050,527],{"class":433},[423,1052,453],{"class":433},[423,1054,1055],{"class":456},"mutateStrict",[423,1057,460],{"class":433},[423,1059,1060],{"class":433},"}}",[423,1062,729],{"class":437},[423,1064,463],{"class":433},[1066,1067,1068,1090],"table",{},[1069,1070,1071],"thead",{},[1072,1073,1074,1078,1081,1084,1087],"tr",{},[1075,1076,1077],"th",{},"Strategy",[1075,1079,1080],{},"What it does",[1075,1082,1083],{},"Mutates your objects",[1075,1085,1086],{},"Undeclared params properties",[1075,1088,1089],{},"Payload",[1091,1092,1093,1113,1130,1149],"tbody",{},[1072,1094,1095,1101,1104,1107,1110],{},[1096,1097,1098],"td",{},[409,1099,1100],{},"clone",[1096,1102,1103],{},"Builds a fresh JSON value from the type, then the platform stringifies it.",[1096,1105,1106],{},"No",[1096,1108,1109],{},"Dropped",[1096,1111,1112],{},"Normal",[1072,1114,1115,1119,1122,1125,1128],{},[1096,1116,1117],{},[409,1118,1001],{},[1096,1120,1121],{},"Rewrites Dates, Maps and the like in place, then the platform stringifies the value.",[1096,1123,1124],{},"Yes",[1096,1126,1127],{},"Kept",[1096,1129,1112],{},[1072,1131,1132,1136,1142,1144,1147],{},[1096,1133,1134],{},[409,1135,1055],{},[1096,1137,1138,1139,1141],{},"Same as ",[409,1140,1001],{},", and rejects the request when a property is undeclared.",[1096,1143,1124],{},[1096,1145,1146],{},"Rejected",[1096,1148,1112],{},[1072,1150,1151,1155,1158,1160,1162],{},[1096,1152,1153],{},[409,1154,934],{},[1096,1156,1157],{},"Drops the key names: an object becomes an array of its declared properties, in order.",[1096,1159,1106],{},[1096,1161,1109],{},[1096,1163,1164],{},"Smallest",[405,1166,1167,1168,1170],{},"Undeclared properties matter most on params, because a caller that is not a mion client can send them. ",[409,1169,1055],{}," is params-only: a return value has no caller to reject.",[1172,1173,1174,1175,1178,1179,663],"note",{},"A dropped property is gone from the params, not set to ",[409,1176,1177],{},"undefined",", so it cannot slip into a database insert. Every strategy also checks unions, where dropping is not enough: see ",[1180,1181,1183],"a",{"href":1182},"\u002Frpc\u002Fserver\u002Fvalidation#undeclared-properties","Undeclared Properties",[817,1185,1187],{"id":1186},"sending-only-what-the-type-declares","Sending Only What the Type Declares",[405,1189,1190,1191,1193,1194,1196],{},"With ",[409,1192,1100],{}," and ",[409,1195,934],{},", the return type decides the payload, not the object the handler returns. Ten database columns come out, three go on the wire, and the password hash cannot leak by accident.",[414,1198,1200],{"className":416,"code":1199,"language":418,"meta":419,"style":419},"  \u002F\u002F returns the whole row, but the PublicUser return type decides what is sent\n  getUser: mion.route((ctx, id: string): PublicUser => db.users.byId(id)),\n",[409,1201,1202,1207],{"__ignoreMap":419},[423,1203,1204],{"class":425,"line":426},[423,1205,1206],{"class":503},"  \u002F\u002F returns the whole row, but the PublicUser return type decides what is sent\n",[423,1208,1209,1212,1214,1216,1218,1220,1222,1224,1226,1228,1231,1233,1235,1237,1240,1242,1245,1247,1250,1252,1255,1258],{"class":425,"line":466},[423,1210,1211],{"class":513},"  getUser",[423,1213,527],{"class":433},[423,1215,660],{"class":437},[423,1217,663],{"class":433},[423,1219,666],{"class":486},[423,1221,669],{"class":437},[423,1223,669],{"class":433},[423,1225,675],{"class":674},[423,1227,441],{"class":433},[423,1229,1230],{"class":674}," id",[423,1232,527],{"class":433},[423,1234,530],{"class":513},[423,1236,687],{"class":433},[423,1238,1239],{"class":513}," PublicUser",[423,1241,692],{"class":476},[423,1243,1244],{"class":437}," db",[423,1246,663],{"class":433},[423,1248,1249],{"class":437},"users",[423,1251,663],{"class":433},[423,1253,1254],{"class":486},"byId",[423,1256,1257],{"class":437},"(id))",[423,1259,803],{"class":433},[817,1261,1263],{"id":1262},"sending-the-returned-object-as-is","Sending the Returned Object As Is",[405,1265,1266,1268],{},[409,1267,1001],{}," is the one strategy that sends the returned object as it is.",[414,1270,1272],{"className":416,"code":1271,"language":418,"meta":419,"style":419},"  \u002F\u002F `mutate` sends the object as is, so this handler builds exactly what the type declares\n  getUserFast: mion.route(\n    (ctx, id: string): PublicUser => {\n      const row = db.users.byId(id);\n      return {id: row.id, name: row.name, avatarUrl: row.avatarUrl};\n    },\n    {parser: 'mutate'}\n  ),\n",[409,1273,1274,1279,1295,1318,1346,1393,1398,1415],{"__ignoreMap":419},[423,1275,1276],{"class":425,"line":426},[423,1277,1278],{"class":503},"  \u002F\u002F `mutate` sends the object as is, so this handler builds exactly what the type declares\n",[423,1280,1281,1284,1286,1288,1290,1292],{"class":425,"line":466},[423,1282,1283],{"class":513},"  getUserFast",[423,1285,527],{"class":433},[423,1287,660],{"class":437},[423,1289,663],{"class":433},[423,1291,666],{"class":486},[423,1293,1294],{"class":437},"(\n",[423,1296,1297,1300,1302,1304,1306,1308,1310,1312,1314,1316],{"class":425,"line":473},[423,1298,1299],{"class":433},"    (",[423,1301,675],{"class":674},[423,1303,441],{"class":433},[423,1305,1230],{"class":674},[423,1307,527],{"class":433},[423,1309,530],{"class":513},[423,1311,687],{"class":433},[423,1313,1239],{"class":513},[423,1315,692],{"class":476},[423,1317,517],{"class":433},[423,1319,1320,1323,1326,1328,1330,1332,1334,1336,1338,1340,1342,1344],{"class":425,"line":495},[423,1321,1322],{"class":476},"      const",[423,1324,1325],{"class":437}," row",[423,1327,613],{"class":433},[423,1329,1244],{"class":437},[423,1331,663],{"class":433},[423,1333,1249],{"class":437},[423,1335,663],{"class":433},[423,1337,1254],{"class":486},[423,1339,669],{"class":523},[423,1341,628],{"class":437},[423,1343,729],{"class":523},[423,1345,463],{"class":433},[423,1347,1348,1351,1353,1355,1357,1359,1361,1363,1365,1368,1370,1372,1374,1377,1379,1382,1384,1386,1388,1391],{"class":425,"line":500},[423,1349,1350],{"class":429},"      return",[423,1352,434],{"class":433},[423,1354,628],{"class":523},[423,1356,527],{"class":433},[423,1358,1325],{"class":437},[423,1360,663],{"class":433},[423,1362,628],{"class":437},[423,1364,441],{"class":433},[423,1366,1367],{"class":523}," name",[423,1369,527],{"class":433},[423,1371,1325],{"class":437},[423,1373,663],{"class":433},[423,1375,1376],{"class":437},"name",[423,1378,441],{"class":433},[423,1380,1381],{"class":523}," avatarUrl",[423,1383,527],{"class":433},[423,1385,1325],{"class":437},[423,1387,663],{"class":433},[423,1389,1390],{"class":437},"avatarUrl",[423,1392,792],{"class":433},[423,1394,1395],{"class":425,"line":507},[423,1396,1397],{"class":433},"    },\n",[423,1399,1400,1403,1405,1407,1409,1411,1413],{"class":425,"line":520},[423,1401,1402],{"class":433},"    {",[423,1404,826],{"class":523},[423,1406,527],{"class":433},[423,1408,453],{"class":433},[423,1410,1001],{"class":456},[423,1412,460],{"class":433},[423,1414,596],{"class":433},[423,1416,1417,1420],{"class":425,"line":535},[423,1418,1419],{"class":437},"  )",[423,1421,803],{"class":433},[1423,1424,1425,1427],"tip",{},[409,1426,1001],{}," is the faster return strategy: it rewrites Dates and the like in place and allocates no copy. It is safe when the handler is done with the object it returns, and the object holds exactly what the type declares.",[817,1429,1431],{"id":1430},"choosing-a-strategy-per-route","Choosing a Strategy Per Route",[405,1433,1434,1435,1437,1438,663],{},"A route or middleware can override the router's ",[409,1436,826],{},", for one direction or both. Give a middleware that takes params or returns data the same strategy when its route uses ",[409,1439,934],{},[414,1441,1443],{"className":416,"code":1442,"language":418,"meta":419,"style":419},"import {createMionRouter, Routes} from '@mionjs\u002Frouter';\n\nconst mion = createMionRouter({basePath: 'api'});\n\ninterface Measurement {\n  sensorId: string;\n  samples: number[];\n}\n\n\u002F\u002F a preset shared by several routes, `as const` so the build reads it like an inline literal\nconst compactRoute = {\n  parser: 'compact',\n  description: 'positional wire',\n} as const;\n\nexport const routes = {\n  \u002F\u002F the router default: clone on both directions\n  echo: mion.route((ctx, data: Measurement): Measurement => data),\n\n  \u002F\u002F compact on both directions, for this route only\n  echoCompact: mion.route((ctx, data: Measurement): Measurement => data, {\n    parser: 'compact',\n  }),\n\n  \u002F\u002F only the return changes; the params keep the router default\n  echoMutate: mion.route((ctx, data: Measurement): Measurement => data, {\n    parser: {return: 'mutate'},\n  }),\n\n  \u002F\u002F refuse a request carrying a property Measurement does not declare\n  echoStrict: mion.route((ctx, data: Measurement): Measurement => data, {\n    parser: {params: 'mutateStrict'},\n  }),\n\n  \u002F\u002F the shared preset\n  echoPreset: mion.route(\n    (ctx, data: Measurement): Measurement => data,\n    compactRoute\n  ),\n\n  \u002F\u002F middleware takes the same option: its params and return use the same wires\n  stamp: mion.middleware(\n    (ctx, tag: string): {tag: string; at: Date} => ({tag, at: new Date()}),\n    {parser: 'compact'}\n  ),\n} satisfies Routes;\n",[409,1444,1445,1469,1473,1503,1507,1516,1527,1541,1545,1549,1554,1565,1579,1595,1606,1610,1622,1627,1666,1670,1675,1714,1729,1737,1742,1748,1788,1810,1819,1824,1830,1870,1891,1900,1905,1911,1927,1952,1958,1965,1970,1976,1993,2059,2076,2083],{"__ignoreMap":419},[423,1446,1447,1449,1451,1453,1455,1457,1459,1461,1463,1465,1467],{"class":425,"line":426},[423,1448,430],{"class":429},[423,1450,434],{"class":433},[423,1452,438],{"class":437},[423,1454,441],{"class":433},[423,1456,444],{"class":437},[423,1458,447],{"class":433},[423,1460,450],{"class":429},[423,1462,453],{"class":433},[423,1464,457],{"class":456},[423,1466,460],{"class":433},[423,1468,463],{"class":433},[423,1470,1471],{"class":425,"line":466},[423,1472,470],{"emptyLinePlaceholder":469},[423,1474,1475,1477,1479,1481,1483,1485,1487,1489,1491,1493,1495,1497,1499,1501],{"class":425,"line":473},[423,1476,477],{"class":476},[423,1478,480],{"class":437},[423,1480,483],{"class":433},[423,1482,487],{"class":486},[423,1484,669],{"class":437},[423,1486,881],{"class":433},[423,1488,884],{"class":523},[423,1490,527],{"class":433},[423,1492,453],{"class":433},[423,1494,891],{"class":456},[423,1496,460],{"class":433},[423,1498,447],{"class":433},[423,1500,729],{"class":437},[423,1502,463],{"class":433},[423,1504,1505],{"class":425,"line":495},[423,1506,470],{"emptyLinePlaceholder":469},[423,1508,1509,1511,1514],{"class":425,"line":500},[423,1510,510],{"class":476},[423,1512,1513],{"class":513}," Measurement",[423,1515,517],{"class":433},[423,1517,1518,1521,1523,1525],{"class":425,"line":507},[423,1519,1520],{"class":523},"  sensorId",[423,1522,527],{"class":433},[423,1524,530],{"class":513},[423,1526,463],{"class":433},[423,1528,1529,1532,1534,1536,1539],{"class":425,"line":520},[423,1530,1531],{"class":523},"  samples",[423,1533,527],{"class":433},[423,1535,555],{"class":513},[423,1537,1538],{"class":437},"[]",[423,1540,463],{"class":433},[423,1542,1543],{"class":425,"line":535},[423,1544,596],{"class":433},[423,1546,1547],{"class":425,"line":547},[423,1548,470],{"emptyLinePlaceholder":469},[423,1550,1551],{"class":425,"line":560},[423,1552,1553],{"class":503},"\u002F\u002F a preset shared by several routes, `as const` so the build reads it like an inline literal\n",[423,1555,1556,1558,1561,1563],{"class":425,"line":573},[423,1557,477],{"class":476},[423,1559,1560],{"class":437}," compactRoute ",[423,1562,483],{"class":433},[423,1564,517],{"class":433},[423,1566,1567,1569,1571,1573,1575,1577],{"class":425,"line":593},[423,1568,974],{"class":523},[423,1570,527],{"class":433},[423,1572,453],{"class":433},[423,1574,934],{"class":456},[423,1576,460],{"class":433},[423,1578,803],{"class":433},[423,1580,1581,1584,1586,1588,1591,1593],{"class":425,"line":599},[423,1582,1583],{"class":523},"  description",[423,1585,527],{"class":433},[423,1587,453],{"class":433},[423,1589,1590],{"class":456},"positional wire",[423,1592,460],{"class":433},[423,1594,803],{"class":433},[423,1596,1597,1599,1602,1604],{"class":425,"line":604},[423,1598,447],{"class":433},[423,1600,1601],{"class":429}," as",[423,1603,869],{"class":476},[423,1605,463],{"class":433},[423,1607,1608],{"class":425,"line":635},[423,1609,470],{"emptyLinePlaceholder":469},[423,1611,1612,1614,1616,1618,1620],{"class":425,"line":640},[423,1613,866],{"class":429},[423,1615,869],{"class":476},[423,1617,645],{"class":437},[423,1619,483],{"class":433},[423,1621,517],{"class":433},[423,1623,1624],{"class":425,"line":652},[423,1625,1626],{"class":503},"  \u002F\u002F the router default: clone on both directions\n",[423,1628,1629,1632,1634,1636,1638,1640,1642,1644,1646,1648,1651,1653,1655,1657,1659,1661,1664],{"class":425,"line":697},[423,1630,1631],{"class":523},"  echo",[423,1633,527],{"class":433},[423,1635,660],{"class":437},[423,1637,663],{"class":433},[423,1639,666],{"class":486},[423,1641,669],{"class":437},[423,1643,669],{"class":433},[423,1645,675],{"class":674},[423,1647,441],{"class":433},[423,1649,1650],{"class":674}," data",[423,1652,527],{"class":433},[423,1654,1513],{"class":513},[423,1656,687],{"class":433},[423,1658,1513],{"class":513},[423,1660,692],{"class":476},[423,1662,1663],{"class":437}," data)",[423,1665,803],{"class":433},[423,1667,1668],{"class":425,"line":703},[423,1669,470],{"emptyLinePlaceholder":469},[423,1671,1672],{"class":425,"line":738},[423,1673,1674],{"class":503},"  \u002F\u002F compact on both directions, for this route only\n",[423,1676,1677,1680,1682,1684,1686,1688,1690,1692,1694,1696,1698,1700,1702,1704,1706,1708,1710,1712],{"class":425,"line":766},[423,1678,1679],{"class":523},"  echoCompact",[423,1681,527],{"class":433},[423,1683,660],{"class":437},[423,1685,663],{"class":433},[423,1687,666],{"class":486},[423,1689,669],{"class":437},[423,1691,669],{"class":433},[423,1693,675],{"class":674},[423,1695,441],{"class":433},[423,1697,1650],{"class":674},[423,1699,527],{"class":433},[423,1701,1513],{"class":513},[423,1703,687],{"class":433},[423,1705,1513],{"class":513},[423,1707,692],{"class":476},[423,1709,1650],{"class":437},[423,1711,441],{"class":433},[423,1713,517],{"class":433},[423,1715,1716,1719,1721,1723,1725,1727],{"class":425,"line":795},[423,1717,1718],{"class":523},"    parser",[423,1720,527],{"class":433},[423,1722,453],{"class":433},[423,1724,934],{"class":456},[423,1726,460],{"class":433},[423,1728,803],{"class":433},[423,1730,1731,1733,1735],{"class":425,"line":806},[423,1732,798],{"class":433},[423,1734,729],{"class":437},[423,1736,803],{"class":433},[423,1738,1740],{"class":425,"line":1739},24,[423,1741,470],{"emptyLinePlaceholder":469},[423,1743,1745],{"class":425,"line":1744},25,[423,1746,1747],{"class":503},"  \u002F\u002F only the return changes; the params keep the router default\n",[423,1749,1751,1754,1756,1758,1760,1762,1764,1766,1768,1770,1772,1774,1776,1778,1780,1782,1784,1786],{"class":425,"line":1750},26,[423,1752,1753],{"class":523},"  echoMutate",[423,1755,527],{"class":433},[423,1757,660],{"class":437},[423,1759,663],{"class":433},[423,1761,666],{"class":486},[423,1763,669],{"class":437},[423,1765,669],{"class":433},[423,1767,675],{"class":674},[423,1769,441],{"class":433},[423,1771,1650],{"class":674},[423,1773,527],{"class":433},[423,1775,1513],{"class":513},[423,1777,687],{"class":433},[423,1779,1513],{"class":513},[423,1781,692],{"class":476},[423,1783,1650],{"class":437},[423,1785,441],{"class":433},[423,1787,517],{"class":433},[423,1789,1791,1793,1795,1797,1800,1802,1804,1806,1808],{"class":425,"line":1790},27,[423,1792,1718],{"class":523},[423,1794,527],{"class":433},[423,1796,434],{"class":433},[423,1798,1799],{"class":523},"return",[423,1801,527],{"class":433},[423,1803,453],{"class":433},[423,1805,1001],{"class":456},[423,1807,460],{"class":433},[423,1809,1006],{"class":433},[423,1811,1813,1815,1817],{"class":425,"line":1812},28,[423,1814,798],{"class":433},[423,1816,729],{"class":437},[423,1818,803],{"class":433},[423,1820,1822],{"class":425,"line":1821},29,[423,1823,470],{"emptyLinePlaceholder":469},[423,1825,1827],{"class":425,"line":1826},30,[423,1828,1829],{"class":503},"  \u002F\u002F refuse a request carrying a property Measurement does not declare\n",[423,1831,1833,1836,1838,1840,1842,1844,1846,1848,1850,1852,1854,1856,1858,1860,1862,1864,1866,1868],{"class":425,"line":1832},31,[423,1834,1835],{"class":523},"  echoStrict",[423,1837,527],{"class":433},[423,1839,660],{"class":437},[423,1841,663],{"class":433},[423,1843,666],{"class":486},[423,1845,669],{"class":437},[423,1847,669],{"class":433},[423,1849,675],{"class":674},[423,1851,441],{"class":433},[423,1853,1650],{"class":674},[423,1855,527],{"class":433},[423,1857,1513],{"class":513},[423,1859,687],{"class":433},[423,1861,1513],{"class":513},[423,1863,692],{"class":476},[423,1865,1650],{"class":437},[423,1867,441],{"class":433},[423,1869,517],{"class":433},[423,1871,1873,1875,1877,1879,1881,1883,1885,1887,1889],{"class":425,"line":1872},32,[423,1874,1718],{"class":523},[423,1876,527],{"class":433},[423,1878,434],{"class":433},[423,1880,981],{"class":523},[423,1882,527],{"class":433},[423,1884,453],{"class":433},[423,1886,1055],{"class":456},[423,1888,460],{"class":433},[423,1890,1006],{"class":433},[423,1892,1894,1896,1898],{"class":425,"line":1893},33,[423,1895,798],{"class":433},[423,1897,729],{"class":437},[423,1899,803],{"class":433},[423,1901,1903],{"class":425,"line":1902},34,[423,1904,470],{"emptyLinePlaceholder":469},[423,1906,1908],{"class":425,"line":1907},35,[423,1909,1910],{"class":503},"  \u002F\u002F the shared preset\n",[423,1912,1914,1917,1919,1921,1923,1925],{"class":425,"line":1913},36,[423,1915,1916],{"class":523},"  echoPreset",[423,1918,527],{"class":433},[423,1920,660],{"class":437},[423,1922,663],{"class":433},[423,1924,666],{"class":486},[423,1926,1294],{"class":437},[423,1928,1930,1932,1934,1936,1938,1940,1942,1944,1946,1948,1950],{"class":425,"line":1929},37,[423,1931,1299],{"class":433},[423,1933,675],{"class":674},[423,1935,441],{"class":433},[423,1937,1650],{"class":674},[423,1939,527],{"class":433},[423,1941,1513],{"class":513},[423,1943,687],{"class":433},[423,1945,1513],{"class":513},[423,1947,692],{"class":476},[423,1949,1650],{"class":437},[423,1951,803],{"class":433},[423,1953,1955],{"class":425,"line":1954},38,[423,1956,1957],{"class":437},"    compactRoute\n",[423,1959,1961,1963],{"class":425,"line":1960},39,[423,1962,1419],{"class":437},[423,1964,803],{"class":433},[423,1966,1968],{"class":425,"line":1967},40,[423,1969,470],{"emptyLinePlaceholder":469},[423,1971,1973],{"class":425,"line":1972},41,[423,1974,1975],{"class":503},"  \u002F\u002F middleware takes the same option: its params and return use the same wires\n",[423,1977,1979,1982,1984,1986,1988,1991],{"class":425,"line":1978},42,[423,1980,1981],{"class":523},"  stamp",[423,1983,527],{"class":433},[423,1985,660],{"class":437},[423,1987,663],{"class":433},[423,1989,1990],{"class":486},"middleware",[423,1992,1294],{"class":437},[423,1994,1996,1998,2000,2002,2005,2007,2009,2011,2013,2016,2018,2020,2022,2025,2027,2029,2031,2033,2036,2038,2040,2042,2044,2046,2049,2051,2053,2055,2057],{"class":425,"line":1995},43,[423,1997,1299],{"class":433},[423,1999,675],{"class":674},[423,2001,441],{"class":433},[423,2003,2004],{"class":674}," tag",[423,2006,527],{"class":433},[423,2008,530],{"class":513},[423,2010,687],{"class":433},[423,2012,434],{"class":433},[423,2014,2015],{"class":523},"tag",[423,2017,527],{"class":433},[423,2019,530],{"class":513},[423,2021,732],{"class":433},[423,2023,2024],{"class":523}," at",[423,2026,527],{"class":433},[423,2028,568],{"class":513},[423,2030,447],{"class":433},[423,2032,692],{"class":476},[423,2034,2035],{"class":437}," (",[423,2037,881],{"class":433},[423,2039,2015],{"class":437},[423,2041,441],{"class":433},[423,2043,2024],{"class":523},[423,2045,527],{"class":433},[423,2047,2048],{"class":433}," new",[423,2050,568],{"class":486},[423,2052,490],{"class":437},[423,2054,447],{"class":433},[423,2056,729],{"class":437},[423,2058,803],{"class":433},[423,2060,2062,2064,2066,2068,2070,2072,2074],{"class":425,"line":2061},44,[423,2063,1402],{"class":433},[423,2065,826],{"class":523},[423,2067,527],{"class":433},[423,2069,453],{"class":433},[423,2071,934],{"class":456},[423,2073,460],{"class":433},[423,2075,596],{"class":433},[423,2077,2079,2081],{"class":425,"line":2078},45,[423,2080,1419],{"class":437},[423,2082,803],{"class":433},[423,2084,2086,2088,2090,2092],{"class":425,"line":2085},46,[423,2087,447],{"class":433},[423,2089,811],{"class":429},[423,2091,444],{"class":513},[423,2093,463],{"class":433},[1423,2095,2096,2097,2099,2100,2103,2104,2106],{},"Write the ",[409,2098,826],{}," option inline or as an ",[409,2101,2102],{},"as const"," preset, because the build reads it. A value built at run time (a function call, a variable typed ",[409,2105,587],{},") is a build error and a lint error, and the router refuses to start when the value it reads differs from what was compiled.",[817,2108,2110],{"id":2109},"what-each-route-compiles","What Each Route Compiles",[405,2112,2113,2114,2116,2117,2119],{},"A route only compiles the functions its strategies need: one validator and one error reporter per direction, plus one encode and decode pair. The default ships the ",[409,2115,1100],{}," pair, ",[409,2118,934],{}," the positional one, and the params validator follows the strategy too. Every strategy hands the platform a value to stringify, so the response framing is the same whichever one you pick.",[817,2121,2123],{"id":2122},"compact-payloads","Compact Payloads",[405,2125,2126,2127,2129,2130,2132,2133,2136,2137,2139],{},"A ",[409,2128,934],{}," payload has no keys, so another service cannot read it by key. Pick ",[409,2131,1100],{}," for an endpoint other tools consume. The ",[1180,2134,2135],{"href":370},"payload sizes benchmark"," compares ",[409,2138,934],{}," with plain JSON, in bytes and speed.",[2141,2142,2143,2147,2182],"ul",{},[2144,2145,2146],"li",{},"Both ends must share the same type, which mion guarantees by sending the compiled functions to the client.",[2144,2148,2149,2150,2153,2154,2157,2158,2161,2162,2164,2165,2168,2169,2171,2172,2157,2175,2178,2179,2181],{},"A missing optional property is sent as the first of ",[409,2151,2152],{},"0",", ",[409,2155,2156],{},"null"," or ",[409,2159,2160],{},"false"," its type cannot hold, and comes back ",[409,2163,1177],{},". So ",[409,2166,2167],{},"s?: string | null"," keeps a present ",[409,2170,2156],{},". An optional that can hold all three, like ",[409,2173,2174],{},"any",[409,2176,2177],{},"unknown",", reads a present ",[409,2180,2156],{}," as missing.",[2144,2183,2184,2185,663],{},"A union of objects is sent as one array holding every member's properties. Each value is wrapped with its member index only when another member is not a plain string, number, boolean or ",[409,2186,2156],{},[2188,2189,2190],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}","How mion encodes params and return values, and how to pick a strategy per route.","md",null,{"toc":24},{"title":56,"description":2191},"d8ng7LiuNWkbwmd-NUal17SD_HbhE8NskMQBbnRD5Zg",1793324369754]