[{"data":1,"prerenderedAt":4154},["ShallowReactive",2],{"navigation_docs":3,"-runtypes-guide-validation":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":52,"body":401,"description":4148,"extension":4149,"links":4150,"meta":4151,"navigation":535,"path":199,"seo":4152,"stem":200,"__hash__":4153},"docs\u002F02.runtypes\u002F02.guide\u002F03.validation.md",{"type":402,"value":403},"minimark",[404,431,469,474,477,692,696,702,921,925,943,947,954,997,1128,1138,1142,1153,1311,1316,1339,1439,1601,1635,1639,1645,2059,2063,2066,2126,2217,2232,2236,2250,2286,2296,2299,2305,3279,3282,3285,3291,3438,3451,3455,3464,3865,3926,3930,3946,4132,4144],[405,406,407,408,412,413,417,418,422,423,426,427,430],"p",{},"Every ",[409,410,411],"code",{},"createX\u003CT>()"," factory turns a type into a function the build writes for you, with no schema object and no runtime reflection. This page covers ",[414,415,416],"strong",{},"validation",": the type guards, the error reports and unknown-key handling. ",[419,420,421],"a",{"href":202},"JSON round trip",", ",[419,424,425],{"href":206},"mocking"," and ",[419,428,429],{"href":196},"reflection"," have their own pages.",[432,433,434,437,438,422,441,444,445,448,449,452,453,456,457,461,462,465,466,468],"note",{},[414,435,436],{},"Validators check serializable data."," ",[409,439,440],{},"createValidateFn",[409,442,443],{},"createGetValidationErrorsFn"," and the JSON codecs work on ",[409,446,447],{},"DataOnly\u003CT>",", the JSON-shaped part of your value. Functions, methods, getters, symbols, promises, ",[409,450,451],{},"RegExp"," and built-ins with no JSON form (typed arrays, ",[409,454,455],{},"Blob",") are skipped. So are ",[419,458,460],{"href":459},"#platform-types","platform classes",". The build names each one in an Info message, shown with ",[409,463,464],{},"levels: 'all'",". If the root type is not serializable, the generated function throws and the build reports a RuntimeError. Decoders also return ",[409,467,447],{},", not the full type.",[470,471,473],"h2",{"id":472},"three-ways-to-call-a-factory","Three Ways to Call a Factory",[405,475,476],{},"Every factory takes your type three different ways, and all three resolve to the same generated function.",[478,479,484],"pre",{"className":480,"code":481,"language":482,"meta":483,"style":483},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F 1. Type-first: you supply the type, no value needed.\nconst isPointA = createValidateFn\u003CPoint>();\n\n\u002F\u002F 2. Value-first: T is inferred from a value you already have.\nconst origin: Point = {x: 0, y: 0};\nconst isPointB = createValidateFn(origin);\n\n\u002F\u002F 3. Run-type: pass the run-type an RT.* builder returned; T is inferred from it.\nconst pointRunType = RT.object({x: TF.number(), y: TF.number()});\nconst isPointC = createValidateFn(pointRunType);\n","ts","",[409,485,486,495,530,537,543,586,603,608,614,675],{"__ignoreMap":483},[487,488,491],"span",{"class":489,"line":490},"line",1,[487,492,494],{"class":493},"sHwdD","\u002F\u002F 1. Type-first: you supply the type, no value needed.\n",[487,496,498,502,506,510,514,517,521,524,527],{"class":489,"line":497},2,[487,499,501],{"class":500},"spNyl","const",[487,503,505],{"class":504},"sTEyZ"," isPointA ",[487,507,509],{"class":508},"sMK4o","=",[487,511,513],{"class":512},"s2Zo4"," createValidateFn",[487,515,516],{"class":508},"\u003C",[487,518,520],{"class":519},"sBMFI","Point",[487,522,523],{"class":508},">",[487,525,526],{"class":504},"()",[487,528,529],{"class":508},";\n",[487,531,533],{"class":489,"line":532},3,[487,534,536],{"emptyLinePlaceholder":535},true,"\n",[487,538,540],{"class":489,"line":539},4,[487,541,542],{"class":493},"\u002F\u002F 2. Value-first: T is inferred from a value you already have.\n",[487,544,546,548,551,554,557,560,563,567,569,573,576,579,581,583],{"class":489,"line":545},5,[487,547,501],{"class":500},[487,549,550],{"class":504}," origin",[487,552,553],{"class":508},":",[487,555,556],{"class":519}," Point",[487,558,559],{"class":508}," =",[487,561,562],{"class":508}," {",[487,564,566],{"class":565},"swJcz","x",[487,568,553],{"class":508},[487,570,572],{"class":571},"sbssI"," 0",[487,574,575],{"class":508},",",[487,577,578],{"class":565}," y",[487,580,553],{"class":508},[487,582,572],{"class":571},[487,584,585],{"class":508},"};\n",[487,587,589,591,594,596,598,601],{"class":489,"line":588},6,[487,590,501],{"class":500},[487,592,593],{"class":504}," isPointB ",[487,595,509],{"class":508},[487,597,513],{"class":512},[487,599,600],{"class":504},"(origin)",[487,602,529],{"class":508},[487,604,606],{"class":489,"line":605},7,[487,607,536],{"emptyLinePlaceholder":535},[487,609,611],{"class":489,"line":610},8,[487,612,613],{"class":493},"\u002F\u002F 3. Run-type: pass the run-type an RT.* builder returned; T is inferred from it.\n",[487,615,617,619,622,624,627,630,633,636,639,641,643,646,648,651,653,655,657,659,661,663,665,667,670,673],{"class":489,"line":616},9,[487,618,501],{"class":500},[487,620,621],{"class":504}," pointRunType ",[487,623,509],{"class":508},[487,625,626],{"class":504}," RT",[487,628,629],{"class":508},".",[487,631,632],{"class":512},"object",[487,634,635],{"class":504},"(",[487,637,638],{"class":508},"{",[487,640,566],{"class":565},[487,642,553],{"class":508},[487,644,645],{"class":504}," TF",[487,647,629],{"class":508},[487,649,650],{"class":512},"number",[487,652,526],{"class":504},[487,654,575],{"class":508},[487,656,578],{"class":565},[487,658,553],{"class":508},[487,660,645],{"class":504},[487,662,629],{"class":508},[487,664,650],{"class":512},[487,666,526],{"class":504},[487,668,669],{"class":508},"}",[487,671,672],{"class":504},")",[487,674,529],{"class":508},[487,676,678,680,683,685,687,690],{"class":489,"line":677},10,[487,679,501],{"class":500},[487,681,682],{"class":504}," isPointC ",[487,684,509],{"class":508},[487,686,513],{"class":512},[487,688,689],{"class":504},"(pointRunType)",[487,691,529],{"class":508},[470,693,695],{"id":694},"type-guards","Type Guards",[405,697,698,701],{},[409,699,700],{},"createValidateFn\u003CT>()"," gives you a type guard: pass a value, get a boolean.",[478,703,705],{"className":480,"code":704,"language":482,"meta":483,"style":483},"const isUser = createValidateFn\u003CUser>();\n\nisUser({id: 1, name: 'Ada', roles: ['admin']}); \u002F\u002F true\nisUser({id: '1', name: 'Ada', roles: ['admin']}); \u002F\u002F false, id is not a number\n\n\u002F\u002F It narrows too: inside the `if`, `data` is typed.\nfunction handle(data: unknown) {\n  if (isUser(data)) data.roles; \u002F\u002F ('admin' | 'user')[]\n}\n",[409,706,707,729,733,797,853,857,862,886,916],{"__ignoreMap":483},[487,708,709,711,714,716,718,720,723,725,727],{"class":489,"line":490},[487,710,501],{"class":500},[487,712,713],{"class":504}," isUser ",[487,715,509],{"class":508},[487,717,513],{"class":512},[487,719,516],{"class":508},[487,721,722],{"class":519},"User",[487,724,523],{"class":508},[487,726,526],{"class":504},[487,728,529],{"class":508},[487,730,731],{"class":489,"line":497},[487,732,536],{"emptyLinePlaceholder":535},[487,734,735,738,740,742,745,747,750,752,755,757,760,764,767,769,772,774,777,779,782,784,787,789,791,794],{"class":489,"line":532},[487,736,737],{"class":512},"isUser",[487,739,635],{"class":504},[487,741,638],{"class":508},[487,743,744],{"class":565},"id",[487,746,553],{"class":508},[487,748,749],{"class":571}," 1",[487,751,575],{"class":508},[487,753,754],{"class":565}," name",[487,756,553],{"class":508},[487,758,759],{"class":508}," '",[487,761,763],{"class":762},"sfazB","Ada",[487,765,766],{"class":508},"'",[487,768,575],{"class":508},[487,770,771],{"class":565}," roles",[487,773,553],{"class":508},[487,775,776],{"class":504}," [",[487,778,766],{"class":508},[487,780,781],{"class":762},"admin",[487,783,766],{"class":508},[487,785,786],{"class":504},"]",[487,788,669],{"class":508},[487,790,672],{"class":504},[487,792,793],{"class":508},";",[487,795,796],{"class":493}," \u002F\u002F true\n",[487,798,799,801,803,805,807,809,811,814,816,818,820,822,824,826,828,830,832,834,836,838,840,842,844,846,848,850],{"class":489,"line":539},[487,800,737],{"class":512},[487,802,635],{"class":504},[487,804,638],{"class":508},[487,806,744],{"class":565},[487,808,553],{"class":508},[487,810,759],{"class":508},[487,812,813],{"class":762},"1",[487,815,766],{"class":508},[487,817,575],{"class":508},[487,819,754],{"class":565},[487,821,553],{"class":508},[487,823,759],{"class":508},[487,825,763],{"class":762},[487,827,766],{"class":508},[487,829,575],{"class":508},[487,831,771],{"class":565},[487,833,553],{"class":508},[487,835,776],{"class":504},[487,837,766],{"class":508},[487,839,781],{"class":762},[487,841,766],{"class":508},[487,843,786],{"class":504},[487,845,669],{"class":508},[487,847,672],{"class":504},[487,849,793],{"class":508},[487,851,852],{"class":493}," \u002F\u002F false, id is not a number\n",[487,854,855],{"class":489,"line":545},[487,856,536],{"emptyLinePlaceholder":535},[487,858,859],{"class":489,"line":588},[487,860,861],{"class":493},"\u002F\u002F It narrows too: inside the `if`, `data` is typed.\n",[487,863,864,867,870,872,876,878,881,883],{"class":489,"line":605},[487,865,866],{"class":500},"function",[487,868,869],{"class":512}," handle",[487,871,635],{"class":508},[487,873,875],{"class":874},"sHdIc","data",[487,877,553],{"class":508},[487,879,880],{"class":519}," unknown",[487,882,672],{"class":508},[487,884,885],{"class":508}," {\n",[487,887,888,892,895,897,899,901,904,906,908,911,913],{"class":489,"line":610},[487,889,891],{"class":890},"s7zQu","  if",[487,893,894],{"class":565}," (",[487,896,737],{"class":512},[487,898,635],{"class":565},[487,900,875],{"class":504},[487,902,903],{"class":565},")) ",[487,905,875],{"class":504},[487,907,629],{"class":508},[487,909,910],{"class":504},"roles",[487,912,793],{"class":508},[487,914,915],{"class":493}," \u002F\u002F ('admin' | 'user')[]\n",[487,917,918],{"class":489,"line":616},[487,919,920],{"class":508},"}\n",[470,922,924],{"id":923},"types-from-other-libraries","Types from Other Libraries",[405,926,927,426,930,933,934,936,937,939,940,942],{},[409,928,929],{},"any",[409,931,932],{},"unknown"," count as data, so types from other libraries keep working. The validator accepts any value there, and a required property only has to be present. A root type of ",[409,935,929],{}," or ",[409,938,932],{}," adds an Info message, and an ",[409,941,929],{}," from an unresolved name or import is a RuntimeError.",[470,944,946],{"id":945},"platform-types","Platform Types",[405,948,949,950,953],{},"A class the platform declares is not data: it is skipped as a property and refused at the root, like a function. What counts as platform depends on your tsconfig ",[409,951,952],{},"types"," list:",[478,955,959],{"className":956,"code":957,"language":958,"meta":483,"style":483},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\"compilerOptions\": {\"types\": [\"node\"]}}\n","json",[409,960,961],{"__ignoreMap":483},[487,962,963,965,968,971,973,975,977,979,981,983,985,987,989,992,994],{"class":489,"line":490},[487,964,638],{"class":508},[487,966,967],{"class":508},"\"",[487,969,970],{"class":500},"compilerOptions",[487,972,967],{"class":508},[487,974,553],{"class":508},[487,976,562],{"class":508},[487,978,967],{"class":508},[487,980,952],{"class":519},[487,982,967],{"class":508},[487,984,553],{"class":508},[487,986,776],{"class":508},[487,988,967],{"class":508},[487,990,991],{"class":762},"node",[487,993,967],{"class":508},[487,995,996],{"class":508},"]}}\n",[998,999,1000,1013],"table",{},[1001,1002,1003],"thead",{},[1004,1005,1006,1010],"tr",{},[1007,1008,1009],"th",{},"Where the class is declared",[1007,1011,1012],{},"Not data?",[1014,1015,1016,1032,1049,1065,1085,1102,1113,1120],"tbody",{},[1004,1017,1018,1029],{},[1019,1020,1021,1022,422,1024,422,1026,672],"td",{},"The TypeScript lib (",[409,1023,44],{},[409,1025,455],{},[409,1027,1028],{},"Error",[1019,1030,1031],{},"Yes",[1004,1033,1034,1047],{},[1019,1035,1036,1037,1039,1040,422,1043,1046],{},"A package in your ",[409,1038,952],{}," list (",[409,1041,1042],{},"@types\u002Fnode",[409,1044,1045],{},"bun-types","), and the files it loads",[1019,1048,1031],{},[1004,1050,1051,1063],{},[1019,1052,1053,1054,894,1057,1060,1061,672],{},"A package another package loads with ",[409,1055,1056],{},"\u002F\u002F\u002F \u003Creference types>",[409,1058,1059],{},"@types\u002Fexpress"," loads ",[409,1062,1042],{},[1019,1064,1031],{},[1004,1066,1067,1083],{},[1019,1068,1069,1070,1073,1074,1039,1076,1079,1080,672],{},"A ",[409,1071,1072],{},"declare module \"x\""," block in a package from your ",[409,1075,952],{},[409,1077,1078],{},"EventEmitter"," from ",[409,1081,1082],{},"events",[1019,1084,1031],{},[1004,1086,1087,1100],{},[1019,1088,1089,1090,1093,1094,1096,1097],{},"Any ",[409,1091,1092],{},"@types"," package, when your ",[409,1095,952],{}," list is ",[409,1098,1099],{},"[\"*\"]",[1019,1101,1031],{},[1004,1103,1104,1110],{},[1019,1105,1106,1107,1109],{},"A package your code imports, but your ",[409,1108,952],{}," list does not name",[1019,1111,1112],{},"No, it stays data",[1004,1114,1115,1118],{},[1019,1116,1117],{},"Your own files",[1019,1119,1112],{},[1004,1121,1122,1125],{},[1019,1123,1124],{},"Your own file that adds a member to a platform class",[1019,1126,1127],{},"No, the class becomes yours",[1129,1130,1131,1132,1134,1135,1137],"tip",{},"With no ",[409,1133,952],{}," list, only the TypeScript lib and what other packages load count, and a type that nothing loads fails the build with marker-any-from-unresolved-name. In the editor, ",[409,1136,447],{}," still shows the shape of a platform class.",[470,1139,1141],{"id":1140},"validation-errors","Validation Errors",[405,1143,1144,1145,1148,1149,1152],{},"Same checks, but you get an array of what failed instead of a boolean. Each entry is ",[409,1146,1147],{},"{path, expected}",", and a format failure adds a ",[409,1150,1151],{},"format"," detail.",[478,1154,1156],{"className":480,"code":1155,"language":482,"meta":483,"style":483},"const userErrors = createGetValidationErrorsFn\u003CUser>();\n\nuserErrors({id: 1, name: 'Ada', roles: ['admin']}); \u002F\u002F [], all good\nuserErrors({id: '1', name: 42, roles: ['boss']});\n\u002F\u002F [\n\u002F\u002F   {path: ['id'], expected: 'number'},\n\u002F\u002F   {path: ['name'], expected: 'string'},\n\u002F\u002F   {path: ['roles', 0], expected: \"'admin' | 'user'\"},\n\u002F\u002F ]\n",[409,1157,1158,1180,1184,1236,1286,1291,1296,1301,1306],{"__ignoreMap":483},[487,1159,1160,1162,1165,1167,1170,1172,1174,1176,1178],{"class":489,"line":490},[487,1161,501],{"class":500},[487,1163,1164],{"class":504}," userErrors ",[487,1166,509],{"class":508},[487,1168,1169],{"class":512}," createGetValidationErrorsFn",[487,1171,516],{"class":508},[487,1173,722],{"class":519},[487,1175,523],{"class":508},[487,1177,526],{"class":504},[487,1179,529],{"class":508},[487,1181,1182],{"class":489,"line":497},[487,1183,536],{"emptyLinePlaceholder":535},[487,1185,1186,1189,1191,1193,1195,1197,1199,1201,1203,1205,1207,1209,1211,1213,1215,1217,1219,1221,1223,1225,1227,1229,1231,1233],{"class":489,"line":532},[487,1187,1188],{"class":512},"userErrors",[487,1190,635],{"class":504},[487,1192,638],{"class":508},[487,1194,744],{"class":565},[487,1196,553],{"class":508},[487,1198,749],{"class":571},[487,1200,575],{"class":508},[487,1202,754],{"class":565},[487,1204,553],{"class":508},[487,1206,759],{"class":508},[487,1208,763],{"class":762},[487,1210,766],{"class":508},[487,1212,575],{"class":508},[487,1214,771],{"class":565},[487,1216,553],{"class":508},[487,1218,776],{"class":504},[487,1220,766],{"class":508},[487,1222,781],{"class":762},[487,1224,766],{"class":508},[487,1226,786],{"class":504},[487,1228,669],{"class":508},[487,1230,672],{"class":504},[487,1232,793],{"class":508},[487,1234,1235],{"class":493}," \u002F\u002F [], all good\n",[487,1237,1238,1240,1242,1244,1246,1248,1250,1252,1254,1256,1258,1260,1263,1265,1267,1269,1271,1273,1276,1278,1280,1282,1284],{"class":489,"line":539},[487,1239,1188],{"class":512},[487,1241,635],{"class":504},[487,1243,638],{"class":508},[487,1245,744],{"class":565},[487,1247,553],{"class":508},[487,1249,759],{"class":508},[487,1251,813],{"class":762},[487,1253,766],{"class":508},[487,1255,575],{"class":508},[487,1257,754],{"class":565},[487,1259,553],{"class":508},[487,1261,1262],{"class":571}," 42",[487,1264,575],{"class":508},[487,1266,771],{"class":565},[487,1268,553],{"class":508},[487,1270,776],{"class":504},[487,1272,766],{"class":508},[487,1274,1275],{"class":762},"boss",[487,1277,766],{"class":508},[487,1279,786],{"class":504},[487,1281,669],{"class":508},[487,1283,672],{"class":504},[487,1285,529],{"class":508},[487,1287,1288],{"class":489,"line":545},[487,1289,1290],{"class":493},"\u002F\u002F [\n",[487,1292,1293],{"class":489,"line":588},[487,1294,1295],{"class":493},"\u002F\u002F   {path: ['id'], expected: 'number'},\n",[487,1297,1298],{"class":489,"line":605},[487,1299,1300],{"class":493},"\u002F\u002F   {path: ['name'], expected: 'string'},\n",[487,1302,1303],{"class":489,"line":610},[487,1304,1305],{"class":493},"\u002F\u002F   {path: ['roles', 0], expected: \"'admin' | 'user'\"},\n",[487,1307,1308],{"class":489,"line":616},[487,1309,1310],{"class":493},"\u002F\u002F ]\n",[1312,1313,1315],"h3",{"id":1314},"format-error-types","Format Error Types",[405,1317,1318,1319,1322,1323,1325,1326,422,1329,422,1332,422,1335,1338],{},"Some formats fail in more than one way, and set an ",[409,1320,1321],{},"errorType"," on the ",[409,1324,1151],{}," detail naming the mode. The modes are stable strings, exported as union types from the formats subpath (",[409,1327,1328],{},"CreditCardErrorType",[409,1330,1331],{},"EmailErrorType",[409,1333,1334],{},"DomainErrorType",[409,1336,1337],{},"IpErrorType",").",[478,1340,1342],{"className":480,"code":1341,"language":482,"meta":483,"style":483},"const errors = getErrors(card);\nswitch (errors[0]?.format?.errorType) {\n  case 'format': \u002F\u002F not shaped like a card number at all\n  case 'checksum': \u002F\u002F right shape, the digits do not add up (a typo)\n  case 'network': \u002F\u002F a good card, just not one this field takes\n}\n",[409,1343,1344,1361,1387,1403,1419,1435],{"__ignoreMap":483},[487,1345,1346,1348,1351,1353,1356,1359],{"class":489,"line":490},[487,1347,501],{"class":500},[487,1349,1350],{"class":504}," errors ",[487,1352,509],{"class":508},[487,1354,1355],{"class":512}," getErrors",[487,1357,1358],{"class":504},"(card)",[487,1360,529],{"class":508},[487,1362,1363,1366,1369,1372,1374,1377,1379,1381,1384],{"class":489,"line":497},[487,1364,1365],{"class":890},"switch",[487,1367,1368],{"class":504}," (errors[",[487,1370,1371],{"class":571},"0",[487,1373,786],{"class":504},[487,1375,1376],{"class":508},"?.",[487,1378,1151],{"class":504},[487,1380,1376],{"class":508},[487,1382,1383],{"class":504},"errorType) ",[487,1385,1386],{"class":508},"{\n",[487,1388,1389,1392,1394,1396,1398,1400],{"class":489,"line":532},[487,1390,1391],{"class":890},"  case",[487,1393,759],{"class":508},[487,1395,1151],{"class":762},[487,1397,766],{"class":508},[487,1399,553],{"class":508},[487,1401,1402],{"class":493}," \u002F\u002F not shaped like a card number at all\n",[487,1404,1405,1407,1409,1412,1414,1416],{"class":489,"line":539},[487,1406,1391],{"class":890},[487,1408,759],{"class":508},[487,1410,1411],{"class":762},"checksum",[487,1413,766],{"class":508},[487,1415,553],{"class":508},[487,1417,1418],{"class":493}," \u002F\u002F right shape, the digits do not add up (a typo)\n",[487,1420,1421,1423,1425,1428,1430,1432],{"class":489,"line":545},[487,1422,1391],{"class":890},[487,1424,759],{"class":508},[487,1426,1427],{"class":762},"network",[487,1429,766],{"class":508},[487,1431,553],{"class":508},[487,1433,1434],{"class":493}," \u002F\u002F a good card, just not one this field takes\n",[487,1436,1437],{"class":489,"line":588},[487,1438,920],{"class":508},[998,1440,1441,1454],{},[1001,1442,1443],{},[1004,1444,1445,1448,1451],{},[1007,1446,1447],{},"Format",[1007,1449,1450],{},"Modes",[1007,1452,1453],{},"When",[1014,1455,1456,1479,1515,1534,1560,1577],{},[1004,1457,1458,1463,1471],{},[1019,1459,1460],{},[409,1461,1462],{},"CreditCard",[1019,1464,1465,422,1467,422,1469],{},[409,1466,1151],{},[409,1468,1411],{},[409,1470,1427],{},[1019,1472,1473,1475,1476],{},[409,1474,1427],{}," only when the field sets ",[409,1477,1478],{},"networks",[1004,1480,1481,1489,1505],{},[1019,1482,1483,422,1486],{},[409,1484,1485],{},"EmailAddress",[409,1487,1488],{},"IdnEmail",[1019,1490,1491,422,1493,422,1496,422,1499,422,1502],{},[409,1492,1151],{},[409,1494,1495],{},"localPart",[409,1497,1498],{},"domain",[409,1500,1501],{},"addressLiteral",[409,1503,1504],{},"length",[1019,1506,1507,1508,1510,1511,1514],{},"which part of the address is wrong (",[409,1509,1151],{}," means no ",[409,1512,1513],{},"@"," at all)",[1004,1516,1517,1522,1528],{},[1019,1518,1519],{},[409,1520,1521],{},"EmailParts",[1019,1523,1524,422,1526],{},[409,1525,1151],{},[409,1527,1495],{},[1019,1529,1530,1531,1533],{},"the domain half reports under the ",[409,1532,1498],{}," format with its own modes",[1004,1535,1536,1544,1557],{},[1019,1537,1538,422,1541],{},[409,1539,1540],{},"Hostname",[409,1542,1543],{},"IdnHostname",[1019,1545,1546,422,1549,422,1552,422,1555],{},[409,1547,1548],{},"label",[409,1550,1551],{},"punycode",[409,1553,1554],{},"bidi",[409,1556,1504],{},[1019,1558,1559],{},"which rule the name broke",[1004,1561,1562,1567,1574],{},[1019,1563,1564],{},[409,1565,1566],{},"DomainParts",[1019,1568,1569,422,1571],{},[409,1570,1548],{},[409,1572,1573],{},"tld",[1019,1575,1576],{},"which label failed",[1004,1578,1579,1590,1598],{},[1019,1580,1581,422,1584,422,1587],{},[409,1582,1583],{},"IPv4WithPort",[409,1585,1586],{},"IPv6WithPort",[409,1588,1589],{},"IPWithPort",[1019,1591,1592,422,1595],{},[409,1593,1594],{},"address",[409,1596,1597],{},"port",[1019,1599,1600],{},"only the port-accepting presets",[1129,1602,1603,1604,422,1607,1610,1611,426,1614,1617,1618,1620,1621,1624,1625,1628,1629,1631,1632,1634],{},"Every format not in the table (",[409,1605,1606],{},"StringUrl",[409,1608,1609],{},"UUIDv4",", the plain ",[409,1612,1613],{},"Email",[409,1615,1616],{},"Domain"," presets, the number and date formats) has one failure mode and leaves ",[409,1619,1321],{}," unset. Each of its constraints reports its own error, and the ",[409,1622,1623],{},"formatPath"," on it says which one. In every format, a bound on the whole value (like ",[409,1626,1627],{},"maxParts"," on ",[409,1630,1566],{},") also leaves ",[409,1633,1321],{}," unset.",[1312,1636,1638],{"id":1637},"typed-error-modes","Typed Error Modes",[405,1640,1641,1642,1644],{},"The ",[409,1643,1151],{}," field is typed from your type: the errors a validator returns list only the formats the type contains.",[478,1646,1648],{"className":480,"code":1647,"language":482,"meta":483,"style":483},"const signUpErrors = createGetValidationErrorsFn\u003CSignUp>();\n\nexport function explain(input: unknown): string[] {\n  const messages: string[] = [];\n  for (const error of signUpErrors(input)) {\n    \u002F\u002F `format.name` narrows `errorType` to that format's own modes, so a typo\n    \u002F\u002F in a mode name is a compile error.\n    switch (error.format?.name) {\n      case 'email':\n        messages.push(\n          error.format.errorType === 'localPart'\n            ? 'Check the part before the @'\n            : 'Check the email address'\n        );\n        break;\n      case 'creditCard':\n        messages.push(\n          error.format.errorType === 'checksum'\n            ? 'Check the card digits'\n            : 'That is not a card we take'\n        );\n        break;\n      default:\n        messages.push(`${error.path.join('.')}: expected ${error.expected}`);\n    }\n  }\n  return messages;\n}\n",[409,1649,1650,1672,1676,1707,1728,1754,1759,1764,1788,1803,1816,1840,1853,1866,1874,1882,1896,1907,1928,1940,1952,1959,1966,1974,2032,2038,2044,2054],{"__ignoreMap":483},[487,1651,1652,1654,1657,1659,1661,1663,1666,1668,1670],{"class":489,"line":490},[487,1653,501],{"class":500},[487,1655,1656],{"class":504}," signUpErrors ",[487,1658,509],{"class":508},[487,1660,1169],{"class":512},[487,1662,516],{"class":508},[487,1664,1665],{"class":519},"SignUp",[487,1667,523],{"class":508},[487,1669,526],{"class":504},[487,1671,529],{"class":508},[487,1673,1674],{"class":489,"line":497},[487,1675,536],{"emptyLinePlaceholder":535},[487,1677,1678,1681,1684,1687,1689,1692,1694,1696,1699,1702,1705],{"class":489,"line":532},[487,1679,1680],{"class":890},"export",[487,1682,1683],{"class":500}," function",[487,1685,1686],{"class":512}," explain",[487,1688,635],{"class":508},[487,1690,1691],{"class":874},"input",[487,1693,553],{"class":508},[487,1695,880],{"class":519},[487,1697,1698],{"class":508},"):",[487,1700,1701],{"class":519}," string",[487,1703,1704],{"class":504},"[] ",[487,1706,1386],{"class":508},[487,1708,1709,1712,1715,1717,1719,1721,1723,1726],{"class":489,"line":539},[487,1710,1711],{"class":500},"  const",[487,1713,1714],{"class":504}," messages",[487,1716,553],{"class":508},[487,1718,1701],{"class":519},[487,1720,1704],{"class":565},[487,1722,509],{"class":508},[487,1724,1725],{"class":565}," []",[487,1727,529],{"class":508},[487,1729,1730,1733,1735,1737,1740,1743,1746,1748,1750,1752],{"class":489,"line":545},[487,1731,1732],{"class":890},"  for",[487,1734,894],{"class":565},[487,1736,501],{"class":500},[487,1738,1739],{"class":504}," error",[487,1741,1742],{"class":508}," of",[487,1744,1745],{"class":512}," signUpErrors",[487,1747,635],{"class":565},[487,1749,1691],{"class":504},[487,1751,903],{"class":565},[487,1753,1386],{"class":508},[487,1755,1756],{"class":489,"line":588},[487,1757,1758],{"class":493},"    \u002F\u002F `format.name` narrows `errorType` to that format's own modes, so a typo\n",[487,1760,1761],{"class":489,"line":605},[487,1762,1763],{"class":493},"    \u002F\u002F in a mode name is a compile error.\n",[487,1765,1766,1769,1771,1774,1776,1778,1780,1783,1786],{"class":489,"line":610},[487,1767,1768],{"class":890},"    switch",[487,1770,894],{"class":565},[487,1772,1773],{"class":504},"error",[487,1775,629],{"class":508},[487,1777,1151],{"class":504},[487,1779,1376],{"class":508},[487,1781,1782],{"class":504},"name",[487,1784,1785],{"class":565},") ",[487,1787,1386],{"class":508},[487,1789,1790,1793,1795,1798,1800],{"class":489,"line":616},[487,1791,1792],{"class":890},"      case",[487,1794,759],{"class":508},[487,1796,1797],{"class":762},"email",[487,1799,766],{"class":508},[487,1801,1802],{"class":508},":\n",[487,1804,1805,1808,1810,1813],{"class":489,"line":677},[487,1806,1807],{"class":504},"        messages",[487,1809,629],{"class":508},[487,1811,1812],{"class":512},"push",[487,1814,1815],{"class":565},"(\n",[487,1817,1819,1822,1824,1826,1828,1830,1833,1835,1837],{"class":489,"line":1818},11,[487,1820,1821],{"class":504},"          error",[487,1823,629],{"class":508},[487,1825,1151],{"class":504},[487,1827,629],{"class":508},[487,1829,1321],{"class":504},[487,1831,1832],{"class":508}," ===",[487,1834,759],{"class":508},[487,1836,1495],{"class":762},[487,1838,1839],{"class":508},"'\n",[487,1841,1843,1846,1848,1851],{"class":489,"line":1842},12,[487,1844,1845],{"class":508},"            ?",[487,1847,759],{"class":508},[487,1849,1850],{"class":762},"Check the part before the @",[487,1852,1839],{"class":508},[487,1854,1856,1859,1861,1864],{"class":489,"line":1855},13,[487,1857,1858],{"class":508},"            :",[487,1860,759],{"class":508},[487,1862,1863],{"class":762},"Check the email address",[487,1865,1839],{"class":508},[487,1867,1869,1872],{"class":489,"line":1868},14,[487,1870,1871],{"class":565},"        )",[487,1873,529],{"class":508},[487,1875,1877,1880],{"class":489,"line":1876},15,[487,1878,1879],{"class":890},"        break",[487,1881,529],{"class":508},[487,1883,1885,1887,1889,1892,1894],{"class":489,"line":1884},16,[487,1886,1792],{"class":890},[487,1888,759],{"class":508},[487,1890,1891],{"class":762},"creditCard",[487,1893,766],{"class":508},[487,1895,1802],{"class":508},[487,1897,1899,1901,1903,1905],{"class":489,"line":1898},17,[487,1900,1807],{"class":504},[487,1902,629],{"class":508},[487,1904,1812],{"class":512},[487,1906,1815],{"class":565},[487,1908,1910,1912,1914,1916,1918,1920,1922,1924,1926],{"class":489,"line":1909},18,[487,1911,1821],{"class":504},[487,1913,629],{"class":508},[487,1915,1151],{"class":504},[487,1917,629],{"class":508},[487,1919,1321],{"class":504},[487,1921,1832],{"class":508},[487,1923,759],{"class":508},[487,1925,1411],{"class":762},[487,1927,1839],{"class":508},[487,1929,1931,1933,1935,1938],{"class":489,"line":1930},19,[487,1932,1845],{"class":508},[487,1934,759],{"class":508},[487,1936,1937],{"class":762},"Check the card digits",[487,1939,1839],{"class":508},[487,1941,1943,1945,1947,1950],{"class":489,"line":1942},20,[487,1944,1858],{"class":508},[487,1946,759],{"class":508},[487,1948,1949],{"class":762},"That is not a card we take",[487,1951,1839],{"class":508},[487,1953,1955,1957],{"class":489,"line":1954},21,[487,1956,1871],{"class":565},[487,1958,529],{"class":508},[487,1960,1962,1964],{"class":489,"line":1961},22,[487,1963,1879],{"class":890},[487,1965,529],{"class":508},[487,1967,1969,1972],{"class":489,"line":1968},23,[487,1970,1971],{"class":890},"      default",[487,1973,1802],{"class":508},[487,1975,1977,1979,1981,1983,1985,1988,1990,1992,1995,1997,2000,2002,2004,2006,2008,2010,2012,2015,2018,2020,2022,2025,2028,2030],{"class":489,"line":1976},24,[487,1978,1807],{"class":504},[487,1980,629],{"class":508},[487,1982,1812],{"class":512},[487,1984,635],{"class":565},[487,1986,1987],{"class":508},"`${",[487,1989,1773],{"class":504},[487,1991,629],{"class":508},[487,1993,1994],{"class":504},"path",[487,1996,629],{"class":508},[487,1998,1999],{"class":512},"join",[487,2001,635],{"class":504},[487,2003,766],{"class":508},[487,2005,629],{"class":762},[487,2007,766],{"class":508},[487,2009,672],{"class":504},[487,2011,669],{"class":508},[487,2013,2014],{"class":762},": expected ",[487,2016,2017],{"class":508},"${",[487,2019,1773],{"class":504},[487,2021,629],{"class":508},[487,2023,2024],{"class":504},"expected",[487,2026,2027],{"class":508},"}`",[487,2029,672],{"class":565},[487,2031,529],{"class":508},[487,2033,2035],{"class":489,"line":2034},25,[487,2036,2037],{"class":508},"    }\n",[487,2039,2041],{"class":489,"line":2040},26,[487,2042,2043],{"class":508},"  }\n",[487,2045,2047,2050,2052],{"class":489,"line":2046},27,[487,2048,2049],{"class":890},"  return",[487,2051,1714],{"class":504},[487,2053,529],{"class":508},[487,2055,2057],{"class":489,"line":2056},28,[487,2058,920],{"class":508},[470,2060,2062],{"id":2061},"validation-options","Validation Options",[405,2064,2065],{},"Both validators take an options object as a second argument.",[478,2067,2069],{"className":480,"code":2068,"language":482,"meta":483,"style":483},"\u002F\u002F accepts NaN and Infinity\nconst isFlagTypeofNumbers = createValidateFn\u003CFlag>(undefined, {\n  numberMode: 'typeof',\n});\n",[409,2070,2071,2076,2101,2118],{"__ignoreMap":483},[487,2072,2073],{"class":489,"line":490},[487,2074,2075],{"class":493},"\u002F\u002F accepts NaN and Infinity\n",[487,2077,2078,2080,2083,2085,2087,2089,2092,2094,2096,2099],{"class":489,"line":497},[487,2079,501],{"class":500},[487,2081,2082],{"class":504}," isFlagTypeofNumbers ",[487,2084,509],{"class":508},[487,2086,513],{"class":512},[487,2088,516],{"class":508},[487,2090,2091],{"class":519},"Flag",[487,2093,523],{"class":508},[487,2095,635],{"class":504},[487,2097,2098],{"class":508},"undefined,",[487,2100,885],{"class":508},[487,2102,2103,2106,2108,2110,2113,2115],{"class":489,"line":532},[487,2104,2105],{"class":565},"  numberMode",[487,2107,553],{"class":508},[487,2109,759],{"class":508},[487,2111,2112],{"class":762},"typeof",[487,2114,766],{"class":508},[487,2116,2117],{"class":508},",\n",[487,2119,2120,2122,2124],{"class":489,"line":539},[487,2121,669],{"class":508},[487,2123,672],{"class":504},[487,2125,529],{"class":508},[998,2127,2128,2138],{},[1001,2129,2130],{},[1004,2131,2132,2135],{},[1007,2133,2134],{},"Option",[1007,2136,2137],{},"What it does",[1014,2139,2140,2176,2190,2204],{},[1004,2141,2142,2147],{},[1019,2143,2144],{},[409,2145,2146],{},"numberMode",[1019,2148,2149,2150,2152,2153,2156,2157,426,2160,2163,2164,2166,2167,2170,2171,2173,2174,629],{},"Chooses how a ",[409,2151,650],{}," is checked. ",[409,2154,2155],{},"isFinite"," (the default) rejects ",[409,2158,2159],{},"NaN",[409,2161,2162],{},"Infinity","; ",[409,2165,2112],{}," accepts them (matching ajv, typia, and JSON Schema); ",[409,2168,2169],{},"notNaN"," rejects ",[409,2172,2159],{}," but keeps ",[409,2175,2162],{},[1004,2177,2178,2183],{},[1019,2179,2180],{},[409,2181,2182],{},"checkUnknowns",[1019,2184,2185,2186,629],{},"Rejects a property your type does not declare, anywhere in the value. See ",[419,2187,2189],{"href":2188},"#checking-for-unknown-keys","Checking for Unknown Keys",[1004,2191,2192,2197],{},[1019,2193,2194],{},[409,2195,2196],{},"checkUnionUnknowns",[1019,2198,2199,2200,629],{},"Rejects an undeclared property on a union member only. See ",[419,2201,2203],{"href":2202},"#unions","Unions",[1004,2205,2206,2211],{},[1019,2207,2208],{},[409,2209,2210],{},"rejectCircularRefs",[1019,2212,2213,2214,629],{},"Rejects a value that contains a reference cycle. The errors form reports it as ",[409,2215,2216],{},"{expected: 'circular'}",[2218,2219,2220,2221,2224,2225,2227,2228,2231],"warning",{},"Pass the options as an ",[414,2222,2223],{},"object literal",", or a ",[409,2226,501],{}," declared ",[409,2229,2230],{},"as const",". They are read at build time, so a value made at runtime is reported as an error.",[1312,2233,2235],{"id":2234},"a-project-wide-number-mode","A Project-Wide Number Mode",[405,2237,2238,2239,2241,2242,2245,2246,2249],{},"Set ",[409,2240,2146],{}," once under a ",[409,2243,2244],{},"validate"," object in the plugin (or the tsconfig ",[409,2247,2248],{},"mion"," plugin entry) and every validator uses it.",[478,2251,2253],{"className":480,"code":2252,"language":482,"meta":483,"style":483},"runtypes({validate: {numberMode: 'typeof'}})\n",[409,2254,2255],{"__ignoreMap":483},[487,2256,2257,2260,2262,2264,2266,2268,2270,2272,2274,2276,2278,2280,2283],{"class":489,"line":490},[487,2258,2259],{"class":512},"runtypes",[487,2261,635],{"class":504},[487,2263,638],{"class":508},[487,2265,2244],{"class":565},[487,2267,553],{"class":508},[487,2269,562],{"class":508},[487,2271,2146],{"class":565},[487,2273,553],{"class":508},[487,2275,759],{"class":508},[487,2277,2112],{"class":762},[487,2279,766],{"class":508},[487,2281,2282],{"class":508},"}}",[487,2284,2285],{"class":504},")\n",[1129,2287,2288,2289,2291,2292,2295],{},"A per-call ",[409,2290,2146],{}," wins over the project default for that validator, so ",[409,2293,2294],{},"numberMode: 'isFinite'"," at a call opts it back out.",[470,2297,2189],{"id":2298},"checking-for-unknown-keys",[405,2300,2301,2302,2304],{},"Unknown keys are properties your declared type does not have. Pass ",[409,2303,2182],{}," to check the type and the extra keys in a single pass.",[478,2306,2308],{"className":480,"code":2307,"language":482,"meta":483,"style":483},"import {createGetValidationErrorsFn, createValidateFn} from '@mionjs\u002Frun-types';\n\ntype Address = {street: string; city: string};\ntype User = {id: number; name: string; address: Address};\n\n\u002F\u002F one function, one pass: matches User and carries no extra property, at every level\nconst isUserStrict = createValidateFn\u003CUser>(undefined, {checkUnknowns: true});\n\nisUserStrict({id: 1, name: 'Ada', address: {street: 'Main', city: 'Rome'}}); \u002F\u002F true\nisUserStrict({\n  id: 1,\n  name: 'Ada',\n  address: {street: 'Main', city: 'Rome'},\n  admin: true,\n}); \u002F\u002F false\nisUserStrict({\n  id: 1,\n  name: 'Ada',\n  address: {street: 'Main', city: 'Rome', zip: '00184'},\n}); \u002F\u002F false, the extra is nested\n\n\u002F\u002F same option on the error report: one entry per undeclared key, `expected: 'never'`\nconst userErrors = createGetValidationErrorsFn\u003CUser>(undefined, {\n  checkUnknowns: true,\n});\n\nuserErrors({\n  id: 1,\n  name: 'Ada',\n  address: {street: 'Main', city: 'Rome', zip: '00184'},\n});\n\u002F\u002F [{path: ['address', 'zip'], expected: 'never'}]\n\n\u002F\u002F a union needs its own option: its members share one list of property names\ntype Pet = {kind: 'cat'; meows: boolean} | {kind: 'dog'; barks: number};\ntype Something = {a: string} | Record\u003Cstring, number>;\n\nconst isPetUnionStrict = createValidateFn\u003CPet>(undefined, {\n  checkUnionUnknowns: true,\n});\nisPetUnionStrict({kind: 'cat', meows: true}); \u002F\u002F true\nisPetUnionStrict({kind: 'cat', meows: true, barks: 3}); \u002F\u002F false, barks belongs to Dog\n\nconst isSomething = createValidateFn\u003CSomething>(undefined, {\n  checkUnionUnknowns: true,\n});\nisSomething({a: 'x'}); \u002F\u002F true\nisSomething({p: 1, q: 2}); \u002F\u002F true, it is a record\nisSomething({a: 'x', evil: 'garbage'}); \u002F\u002F false, it matches neither member\n\nexport {isUserStrict, userErrors, isPetUnionStrict, isSomething};\n",[409,2309,2310,2337,2341,2371,2408,2412,2417,2454,2458,2525,2533,2544,2559,2593,2604,2615,2623,2633,2647,2693,2704,2708,2713,2735,2746,2754,2758,2766,2776,2791,2836,2845,2851,2856,2862,2925,2962,2967,2992,3004,3013,3049,3094,3099,3124,3135,3144,3172,3206,3248,3253],{"__ignoreMap":483},[487,2311,2312,2315,2317,2319,2321,2323,2325,2328,2330,2333,2335],{"class":489,"line":490},[487,2313,2314],{"class":890},"import",[487,2316,562],{"class":508},[487,2318,443],{"class":504},[487,2320,575],{"class":508},[487,2322,513],{"class":504},[487,2324,669],{"class":508},[487,2326,2327],{"class":890}," from",[487,2329,759],{"class":508},[487,2331,2332],{"class":762},"@mionjs\u002Frun-types",[487,2334,766],{"class":508},[487,2336,529],{"class":508},[487,2338,2339],{"class":489,"line":497},[487,2340,536],{"emptyLinePlaceholder":535},[487,2342,2343,2346,2349,2351,2353,2356,2358,2360,2362,2365,2367,2369],{"class":489,"line":532},[487,2344,2345],{"class":500},"type",[487,2347,2348],{"class":519}," Address",[487,2350,559],{"class":508},[487,2352,562],{"class":508},[487,2354,2355],{"class":565},"street",[487,2357,553],{"class":508},[487,2359,1701],{"class":519},[487,2361,793],{"class":508},[487,2363,2364],{"class":565}," city",[487,2366,553],{"class":508},[487,2368,1701],{"class":519},[487,2370,585],{"class":508},[487,2372,2373,2375,2378,2380,2382,2384,2386,2389,2391,2393,2395,2397,2399,2402,2404,2406],{"class":489,"line":539},[487,2374,2345],{"class":500},[487,2376,2377],{"class":519}," User",[487,2379,559],{"class":508},[487,2381,562],{"class":508},[487,2383,744],{"class":565},[487,2385,553],{"class":508},[487,2387,2388],{"class":519}," number",[487,2390,793],{"class":508},[487,2392,754],{"class":565},[487,2394,553],{"class":508},[487,2396,1701],{"class":519},[487,2398,793],{"class":508},[487,2400,2401],{"class":565}," address",[487,2403,553],{"class":508},[487,2405,2348],{"class":519},[487,2407,585],{"class":508},[487,2409,2410],{"class":489,"line":545},[487,2411,536],{"emptyLinePlaceholder":535},[487,2413,2414],{"class":489,"line":588},[487,2415,2416],{"class":493},"\u002F\u002F one function, one pass: matches User and carries no extra property, at every level\n",[487,2418,2419,2421,2424,2426,2428,2430,2432,2434,2436,2438,2440,2442,2444,2448,2450,2452],{"class":489,"line":605},[487,2420,501],{"class":500},[487,2422,2423],{"class":504}," isUserStrict ",[487,2425,509],{"class":508},[487,2427,513],{"class":512},[487,2429,516],{"class":508},[487,2431,722],{"class":519},[487,2433,523],{"class":508},[487,2435,635],{"class":504},[487,2437,2098],{"class":508},[487,2439,562],{"class":508},[487,2441,2182],{"class":565},[487,2443,553],{"class":508},[487,2445,2447],{"class":2446},"sfNiH"," true",[487,2449,669],{"class":508},[487,2451,672],{"class":504},[487,2453,529],{"class":508},[487,2455,2456],{"class":489,"line":610},[487,2457,536],{"emptyLinePlaceholder":535},[487,2459,2460,2463,2465,2467,2469,2471,2473,2475,2477,2479,2481,2483,2485,2487,2489,2491,2493,2495,2497,2499,2502,2504,2506,2508,2510,2512,2515,2517,2519,2521,2523],{"class":489,"line":616},[487,2461,2462],{"class":512},"isUserStrict",[487,2464,635],{"class":504},[487,2466,638],{"class":508},[487,2468,744],{"class":565},[487,2470,553],{"class":508},[487,2472,749],{"class":571},[487,2474,575],{"class":508},[487,2476,754],{"class":565},[487,2478,553],{"class":508},[487,2480,759],{"class":508},[487,2482,763],{"class":762},[487,2484,766],{"class":508},[487,2486,575],{"class":508},[487,2488,2401],{"class":565},[487,2490,553],{"class":508},[487,2492,562],{"class":508},[487,2494,2355],{"class":565},[487,2496,553],{"class":508},[487,2498,759],{"class":508},[487,2500,2501],{"class":762},"Main",[487,2503,766],{"class":508},[487,2505,575],{"class":508},[487,2507,2364],{"class":565},[487,2509,553],{"class":508},[487,2511,759],{"class":508},[487,2513,2514],{"class":762},"Rome",[487,2516,766],{"class":508},[487,2518,2282],{"class":508},[487,2520,672],{"class":504},[487,2522,793],{"class":508},[487,2524,796],{"class":493},[487,2526,2527,2529,2531],{"class":489,"line":677},[487,2528,2462],{"class":512},[487,2530,635],{"class":504},[487,2532,1386],{"class":508},[487,2534,2535,2538,2540,2542],{"class":489,"line":1818},[487,2536,2537],{"class":565},"  id",[487,2539,553],{"class":508},[487,2541,749],{"class":571},[487,2543,2117],{"class":508},[487,2545,2546,2549,2551,2553,2555,2557],{"class":489,"line":1842},[487,2547,2548],{"class":565},"  name",[487,2550,553],{"class":508},[487,2552,759],{"class":508},[487,2554,763],{"class":762},[487,2556,766],{"class":508},[487,2558,2117],{"class":508},[487,2560,2561,2564,2566,2568,2570,2572,2574,2576,2578,2580,2582,2584,2586,2588,2590],{"class":489,"line":1855},[487,2562,2563],{"class":565},"  address",[487,2565,553],{"class":508},[487,2567,562],{"class":508},[487,2569,2355],{"class":565},[487,2571,553],{"class":508},[487,2573,759],{"class":508},[487,2575,2501],{"class":762},[487,2577,766],{"class":508},[487,2579,575],{"class":508},[487,2581,2364],{"class":565},[487,2583,553],{"class":508},[487,2585,759],{"class":508},[487,2587,2514],{"class":762},[487,2589,766],{"class":508},[487,2591,2592],{"class":508},"},\n",[487,2594,2595,2598,2600,2602],{"class":489,"line":1868},[487,2596,2597],{"class":565},"  admin",[487,2599,553],{"class":508},[487,2601,2447],{"class":2446},[487,2603,2117],{"class":508},[487,2605,2606,2608,2610,2612],{"class":489,"line":1876},[487,2607,669],{"class":508},[487,2609,672],{"class":504},[487,2611,793],{"class":508},[487,2613,2614],{"class":493}," \u002F\u002F false\n",[487,2616,2617,2619,2621],{"class":489,"line":1884},[487,2618,2462],{"class":512},[487,2620,635],{"class":504},[487,2622,1386],{"class":508},[487,2624,2625,2627,2629,2631],{"class":489,"line":1898},[487,2626,2537],{"class":565},[487,2628,553],{"class":508},[487,2630,749],{"class":571},[487,2632,2117],{"class":508},[487,2634,2635,2637,2639,2641,2643,2645],{"class":489,"line":1909},[487,2636,2548],{"class":565},[487,2638,553],{"class":508},[487,2640,759],{"class":508},[487,2642,763],{"class":762},[487,2644,766],{"class":508},[487,2646,2117],{"class":508},[487,2648,2649,2651,2653,2655,2657,2659,2661,2663,2665,2667,2669,2671,2673,2675,2677,2679,2682,2684,2686,2689,2691],{"class":489,"line":1930},[487,2650,2563],{"class":565},[487,2652,553],{"class":508},[487,2654,562],{"class":508},[487,2656,2355],{"class":565},[487,2658,553],{"class":508},[487,2660,759],{"class":508},[487,2662,2501],{"class":762},[487,2664,766],{"class":508},[487,2666,575],{"class":508},[487,2668,2364],{"class":565},[487,2670,553],{"class":508},[487,2672,759],{"class":508},[487,2674,2514],{"class":762},[487,2676,766],{"class":508},[487,2678,575],{"class":508},[487,2680,2681],{"class":565}," zip",[487,2683,553],{"class":508},[487,2685,759],{"class":508},[487,2687,2688],{"class":762},"00184",[487,2690,766],{"class":508},[487,2692,2592],{"class":508},[487,2694,2695,2697,2699,2701],{"class":489,"line":1942},[487,2696,669],{"class":508},[487,2698,672],{"class":504},[487,2700,793],{"class":508},[487,2702,2703],{"class":493}," \u002F\u002F false, the extra is nested\n",[487,2705,2706],{"class":489,"line":1954},[487,2707,536],{"emptyLinePlaceholder":535},[487,2709,2710],{"class":489,"line":1961},[487,2711,2712],{"class":493},"\u002F\u002F same option on the error report: one entry per undeclared key, `expected: 'never'`\n",[487,2714,2715,2717,2719,2721,2723,2725,2727,2729,2731,2733],{"class":489,"line":1968},[487,2716,501],{"class":500},[487,2718,1164],{"class":504},[487,2720,509],{"class":508},[487,2722,1169],{"class":512},[487,2724,516],{"class":508},[487,2726,722],{"class":519},[487,2728,523],{"class":508},[487,2730,635],{"class":504},[487,2732,2098],{"class":508},[487,2734,885],{"class":508},[487,2736,2737,2740,2742,2744],{"class":489,"line":1976},[487,2738,2739],{"class":565},"  checkUnknowns",[487,2741,553],{"class":508},[487,2743,2447],{"class":2446},[487,2745,2117],{"class":508},[487,2747,2748,2750,2752],{"class":489,"line":2034},[487,2749,669],{"class":508},[487,2751,672],{"class":504},[487,2753,529],{"class":508},[487,2755,2756],{"class":489,"line":2040},[487,2757,536],{"emptyLinePlaceholder":535},[487,2759,2760,2762,2764],{"class":489,"line":2046},[487,2761,1188],{"class":512},[487,2763,635],{"class":504},[487,2765,1386],{"class":508},[487,2767,2768,2770,2772,2774],{"class":489,"line":2056},[487,2769,2537],{"class":565},[487,2771,553],{"class":508},[487,2773,749],{"class":571},[487,2775,2117],{"class":508},[487,2777,2779,2781,2783,2785,2787,2789],{"class":489,"line":2778},29,[487,2780,2548],{"class":565},[487,2782,553],{"class":508},[487,2784,759],{"class":508},[487,2786,763],{"class":762},[487,2788,766],{"class":508},[487,2790,2117],{"class":508},[487,2792,2794,2796,2798,2800,2802,2804,2806,2808,2810,2812,2814,2816,2818,2820,2822,2824,2826,2828,2830,2832,2834],{"class":489,"line":2793},30,[487,2795,2563],{"class":565},[487,2797,553],{"class":508},[487,2799,562],{"class":508},[487,2801,2355],{"class":565},[487,2803,553],{"class":508},[487,2805,759],{"class":508},[487,2807,2501],{"class":762},[487,2809,766],{"class":508},[487,2811,575],{"class":508},[487,2813,2364],{"class":565},[487,2815,553],{"class":508},[487,2817,759],{"class":508},[487,2819,2514],{"class":762},[487,2821,766],{"class":508},[487,2823,575],{"class":508},[487,2825,2681],{"class":565},[487,2827,553],{"class":508},[487,2829,759],{"class":508},[487,2831,2688],{"class":762},[487,2833,766],{"class":508},[487,2835,2592],{"class":508},[487,2837,2839,2841,2843],{"class":489,"line":2838},31,[487,2840,669],{"class":508},[487,2842,672],{"class":504},[487,2844,529],{"class":508},[487,2846,2848],{"class":489,"line":2847},32,[487,2849,2850],{"class":493},"\u002F\u002F [{path: ['address', 'zip'], expected: 'never'}]\n",[487,2852,2854],{"class":489,"line":2853},33,[487,2855,536],{"emptyLinePlaceholder":535},[487,2857,2859],{"class":489,"line":2858},34,[487,2860,2861],{"class":493},"\u002F\u002F a union needs its own option: its members share one list of property names\n",[487,2863,2865,2867,2870,2872,2874,2877,2879,2881,2884,2886,2888,2891,2893,2896,2898,2901,2903,2905,2907,2909,2912,2914,2916,2919,2921,2923],{"class":489,"line":2864},35,[487,2866,2345],{"class":500},[487,2868,2869],{"class":519}," Pet",[487,2871,559],{"class":508},[487,2873,562],{"class":508},[487,2875,2876],{"class":565},"kind",[487,2878,553],{"class":508},[487,2880,759],{"class":508},[487,2882,2883],{"class":762},"cat",[487,2885,766],{"class":508},[487,2887,793],{"class":508},[487,2889,2890],{"class":565}," meows",[487,2892,553],{"class":508},[487,2894,2895],{"class":519}," boolean",[487,2897,669],{"class":508},[487,2899,2900],{"class":508}," |",[487,2902,562],{"class":508},[487,2904,2876],{"class":565},[487,2906,553],{"class":508},[487,2908,759],{"class":508},[487,2910,2911],{"class":762},"dog",[487,2913,766],{"class":508},[487,2915,793],{"class":508},[487,2917,2918],{"class":565}," barks",[487,2920,553],{"class":508},[487,2922,2388],{"class":519},[487,2924,585],{"class":508},[487,2926,2928,2930,2933,2935,2937,2939,2941,2943,2945,2947,2950,2952,2955,2957,2959],{"class":489,"line":2927},36,[487,2929,2345],{"class":500},[487,2931,2932],{"class":519}," Something",[487,2934,559],{"class":508},[487,2936,562],{"class":508},[487,2938,419],{"class":565},[487,2940,553],{"class":508},[487,2942,1701],{"class":519},[487,2944,669],{"class":508},[487,2946,2900],{"class":508},[487,2948,2949],{"class":519}," Record",[487,2951,516],{"class":508},[487,2953,2954],{"class":519},"string",[487,2956,575],{"class":508},[487,2958,2388],{"class":519},[487,2960,2961],{"class":508},">;\n",[487,2963,2965],{"class":489,"line":2964},37,[487,2966,536],{"emptyLinePlaceholder":535},[487,2968,2970,2972,2975,2977,2979,2981,2984,2986,2988,2990],{"class":489,"line":2969},38,[487,2971,501],{"class":500},[487,2973,2974],{"class":504}," isPetUnionStrict ",[487,2976,509],{"class":508},[487,2978,513],{"class":512},[487,2980,516],{"class":508},[487,2982,2983],{"class":519},"Pet",[487,2985,523],{"class":508},[487,2987,635],{"class":504},[487,2989,2098],{"class":508},[487,2991,885],{"class":508},[487,2993,2995,2998,3000,3002],{"class":489,"line":2994},39,[487,2996,2997],{"class":565},"  checkUnionUnknowns",[487,2999,553],{"class":508},[487,3001,2447],{"class":2446},[487,3003,2117],{"class":508},[487,3005,3007,3009,3011],{"class":489,"line":3006},40,[487,3008,669],{"class":508},[487,3010,672],{"class":504},[487,3012,529],{"class":508},[487,3014,3016,3019,3021,3023,3025,3027,3029,3031,3033,3035,3037,3039,3041,3043,3045,3047],{"class":489,"line":3015},41,[487,3017,3018],{"class":512},"isPetUnionStrict",[487,3020,635],{"class":504},[487,3022,638],{"class":508},[487,3024,2876],{"class":565},[487,3026,553],{"class":508},[487,3028,759],{"class":508},[487,3030,2883],{"class":762},[487,3032,766],{"class":508},[487,3034,575],{"class":508},[487,3036,2890],{"class":565},[487,3038,553],{"class":508},[487,3040,2447],{"class":2446},[487,3042,669],{"class":508},[487,3044,672],{"class":504},[487,3046,793],{"class":508},[487,3048,796],{"class":493},[487,3050,3052,3054,3056,3058,3060,3062,3064,3066,3068,3070,3072,3074,3076,3078,3080,3082,3085,3087,3089,3091],{"class":489,"line":3051},42,[487,3053,3018],{"class":512},[487,3055,635],{"class":504},[487,3057,638],{"class":508},[487,3059,2876],{"class":565},[487,3061,553],{"class":508},[487,3063,759],{"class":508},[487,3065,2883],{"class":762},[487,3067,766],{"class":508},[487,3069,575],{"class":508},[487,3071,2890],{"class":565},[487,3073,553],{"class":508},[487,3075,2447],{"class":2446},[487,3077,575],{"class":508},[487,3079,2918],{"class":565},[487,3081,553],{"class":508},[487,3083,3084],{"class":571}," 3",[487,3086,669],{"class":508},[487,3088,672],{"class":504},[487,3090,793],{"class":508},[487,3092,3093],{"class":493}," \u002F\u002F false, barks belongs to Dog\n",[487,3095,3097],{"class":489,"line":3096},43,[487,3098,536],{"emptyLinePlaceholder":535},[487,3100,3102,3104,3107,3109,3111,3113,3116,3118,3120,3122],{"class":489,"line":3101},44,[487,3103,501],{"class":500},[487,3105,3106],{"class":504}," isSomething ",[487,3108,509],{"class":508},[487,3110,513],{"class":512},[487,3112,516],{"class":508},[487,3114,3115],{"class":519},"Something",[487,3117,523],{"class":508},[487,3119,635],{"class":504},[487,3121,2098],{"class":508},[487,3123,885],{"class":508},[487,3125,3127,3129,3131,3133],{"class":489,"line":3126},45,[487,3128,2997],{"class":565},[487,3130,553],{"class":508},[487,3132,2447],{"class":2446},[487,3134,2117],{"class":508},[487,3136,3138,3140,3142],{"class":489,"line":3137},46,[487,3139,669],{"class":508},[487,3141,672],{"class":504},[487,3143,529],{"class":508},[487,3145,3147,3150,3152,3154,3156,3158,3160,3162,3164,3166,3168,3170],{"class":489,"line":3146},47,[487,3148,3149],{"class":512},"isSomething",[487,3151,635],{"class":504},[487,3153,638],{"class":508},[487,3155,419],{"class":565},[487,3157,553],{"class":508},[487,3159,759],{"class":508},[487,3161,566],{"class":762},[487,3163,766],{"class":508},[487,3165,669],{"class":508},[487,3167,672],{"class":504},[487,3169,793],{"class":508},[487,3171,796],{"class":493},[487,3173,3175,3177,3179,3181,3183,3185,3187,3189,3192,3194,3197,3199,3201,3203],{"class":489,"line":3174},48,[487,3176,3149],{"class":512},[487,3178,635],{"class":504},[487,3180,638],{"class":508},[487,3182,405],{"class":565},[487,3184,553],{"class":508},[487,3186,749],{"class":571},[487,3188,575],{"class":508},[487,3190,3191],{"class":565}," q",[487,3193,553],{"class":508},[487,3195,3196],{"class":571}," 2",[487,3198,669],{"class":508},[487,3200,672],{"class":504},[487,3202,793],{"class":508},[487,3204,3205],{"class":493}," \u002F\u002F true, it is a record\n",[487,3207,3209,3211,3213,3215,3217,3219,3221,3223,3225,3227,3230,3232,3234,3237,3239,3241,3243,3245],{"class":489,"line":3208},49,[487,3210,3149],{"class":512},[487,3212,635],{"class":504},[487,3214,638],{"class":508},[487,3216,419],{"class":565},[487,3218,553],{"class":508},[487,3220,759],{"class":508},[487,3222,566],{"class":762},[487,3224,766],{"class":508},[487,3226,575],{"class":508},[487,3228,3229],{"class":565}," evil",[487,3231,553],{"class":508},[487,3233,759],{"class":508},[487,3235,3236],{"class":762},"garbage",[487,3238,766],{"class":508},[487,3240,669],{"class":508},[487,3242,672],{"class":504},[487,3244,793],{"class":508},[487,3246,3247],{"class":493}," \u002F\u002F false, it matches neither member\n",[487,3249,3251],{"class":489,"line":3250},50,[487,3252,536],{"emptyLinePlaceholder":535},[487,3254,3256,3258,3260,3262,3264,3267,3269,3272,3274,3277],{"class":489,"line":3255},51,[487,3257,1680],{"class":890},[487,3259,562],{"class":508},[487,3261,2462],{"class":504},[487,3263,575],{"class":508},[487,3265,3266],{"class":504}," userErrors",[487,3268,575],{"class":508},[487,3270,3271],{"class":504}," isPetUnionStrict",[487,3273,575],{"class":508},[487,3275,3276],{"class":504}," isSomething",[487,3278,585],{"class":508},[1129,3280,3281],{},"Errors come out in the order the value is walked, so a nested object's errors arrive together rather than grouped by kind.",[1312,3283,2203],{"id":3284},"unions",[405,3286,3287,3288,3290],{},"A union needs its own option: its members share one list of property names, and a member with an index signature declares every property. ",[409,3289,2196],{}," checks the property list of the member that actually matched. It does nothing outside a union, so pair it with a decoder that already dropped the rest.",[478,3292,3294],{"className":480,"code":3293,"language":482,"meta":483,"style":483},"type Pet = {kind: 'cat'; meows: boolean} | {kind: 'dog'; barks: number};\n\u002F\u002F {kind: 'cat', meows: true, barks: 3}  ->  rejected, barks belongs to Dog, not to Cat\n\ntype Something = {a: string} | Record\u003Cstring, number>;\n\u002F\u002F {a: 'x', evil: 'garbage'}  ->  rejected, it matches neither member\n\ntype Loose = {a: string} | Record\u003Cstring, string>;\n\u002F\u002F {a: 'x', evil: 'garbage'}  ->  accepted, every value is a string\n",[409,3295,3296,3350,3355,3359,3391,3396,3400,3433],{"__ignoreMap":483},[487,3297,3298,3300,3302,3304,3306,3308,3310,3312,3314,3316,3318,3320,3322,3324,3326,3328,3330,3332,3334,3336,3338,3340,3342,3344,3346,3348],{"class":489,"line":490},[487,3299,2345],{"class":500},[487,3301,2869],{"class":519},[487,3303,559],{"class":508},[487,3305,562],{"class":508},[487,3307,2876],{"class":565},[487,3309,553],{"class":508},[487,3311,759],{"class":508},[487,3313,2883],{"class":762},[487,3315,766],{"class":508},[487,3317,793],{"class":508},[487,3319,2890],{"class":565},[487,3321,553],{"class":508},[487,3323,2895],{"class":519},[487,3325,669],{"class":508},[487,3327,2900],{"class":508},[487,3329,562],{"class":508},[487,3331,2876],{"class":565},[487,3333,553],{"class":508},[487,3335,759],{"class":508},[487,3337,2911],{"class":762},[487,3339,766],{"class":508},[487,3341,793],{"class":508},[487,3343,2918],{"class":565},[487,3345,553],{"class":508},[487,3347,2388],{"class":519},[487,3349,585],{"class":508},[487,3351,3352],{"class":489,"line":497},[487,3353,3354],{"class":493},"\u002F\u002F {kind: 'cat', meows: true, barks: 3}  ->  rejected, barks belongs to Dog, not to Cat\n",[487,3356,3357],{"class":489,"line":532},[487,3358,536],{"emptyLinePlaceholder":535},[487,3360,3361,3363,3365,3367,3369,3371,3373,3375,3377,3379,3381,3383,3385,3387,3389],{"class":489,"line":539},[487,3362,2345],{"class":500},[487,3364,2932],{"class":519},[487,3366,559],{"class":508},[487,3368,562],{"class":508},[487,3370,419],{"class":565},[487,3372,553],{"class":508},[487,3374,1701],{"class":519},[487,3376,669],{"class":508},[487,3378,2900],{"class":508},[487,3380,2949],{"class":519},[487,3382,516],{"class":508},[487,3384,2954],{"class":519},[487,3386,575],{"class":508},[487,3388,2388],{"class":519},[487,3390,2961],{"class":508},[487,3392,3393],{"class":489,"line":545},[487,3394,3395],{"class":493},"\u002F\u002F {a: 'x', evil: 'garbage'}  ->  rejected, it matches neither member\n",[487,3397,3398],{"class":489,"line":588},[487,3399,536],{"emptyLinePlaceholder":535},[487,3401,3402,3404,3407,3409,3411,3413,3415,3417,3419,3421,3423,3425,3427,3429,3431],{"class":489,"line":605},[487,3403,2345],{"class":500},[487,3405,3406],{"class":519}," Loose",[487,3408,559],{"class":508},[487,3410,562],{"class":508},[487,3412,419],{"class":565},[487,3414,553],{"class":508},[487,3416,1701],{"class":519},[487,3418,669],{"class":508},[487,3420,2900],{"class":508},[487,3422,2949],{"class":519},[487,3424,516],{"class":508},[487,3426,2954],{"class":519},[487,3428,575],{"class":508},[487,3430,1701],{"class":519},[487,3432,2961],{"class":508},[487,3434,3435],{"class":489,"line":610},[487,3436,3437],{"class":493},"\u002F\u002F {a: 'x', evil: 'garbage'}  ->  accepted, every value is a string\n",[1129,3439,3440,3441,3444,3445,3447,3448,3450],{},"The check runs only when the union has two or more members that carry properties by name, so ",[409,3442,3443],{},"{a: string} | number"," answers as plain ",[409,3446,2244],{}," does. Set both options and ",[409,3449,2182],{}," wins.",[470,3452,3454],{"id":3453},"removing-unknown-keys","Removing Unknown Keys",[405,3456,3457,3459,3460,3463],{},[409,3458,2182],{}," rejects extra keys, ",[409,3461,3462],{},"createRemoveUnknownKeysFn"," drops them. The copy keeps every member your type declares, or the build fails.",[478,3465,3467],{"className":480,"code":3466,"language":482,"meta":483,"style":483},"import {createRemoveUnknownKeysFn, createValidateFn} from '@mionjs\u002Frun-types';\n\ntype User = {id: number; name: string};\n\n\u002F\u002F never changes the input, so frozen inputs work\nconst removeUnknownKeys = createRemoveUnknownKeysFn\u003CUser>();\n\nconst dirty = {id: 1, name: 'Ada', admin: true, token: 'secret'};\nconst clean = removeUnknownKeys(dirty as User); \u002F\u002F {id: 1, name: 'Ada'}, new object\n\n\u002F\u002F validate untrusted data first, then drop its extra keys\nconst isUser = createValidateFn\u003CUser>();\nexport function parseUser(data: unknown): User {\n  if (!isUser(data)) throw new Error('not a User');\n  return removeUnknownKeys(data);\n}\n\n\u002F\u002F onClick is shared with the input: 'share' hides the warning, 'refuse' makes it a build error\ntype Button = {label: string; onClick: () => void};\nconst removeButtonKeys = createRemoveUnknownKeysFn\u003CButton>(undefined, {\n  sharedValues: 'share',\n});\n\nexport {removeUnknownKeys, clean, removeButtonKeys};\n",[409,3468,3469,3493,3497,3523,3527,3532,3554,3558,3612,3639,3643,3648,3668,3691,3730,3744,3748,3752,3757,3792,3816,3832,3840,3844],{"__ignoreMap":483},[487,3470,3471,3473,3475,3477,3479,3481,3483,3485,3487,3489,3491],{"class":489,"line":490},[487,3472,2314],{"class":890},[487,3474,562],{"class":508},[487,3476,3462],{"class":504},[487,3478,575],{"class":508},[487,3480,513],{"class":504},[487,3482,669],{"class":508},[487,3484,2327],{"class":890},[487,3486,759],{"class":508},[487,3488,2332],{"class":762},[487,3490,766],{"class":508},[487,3492,529],{"class":508},[487,3494,3495],{"class":489,"line":497},[487,3496,536],{"emptyLinePlaceholder":535},[487,3498,3499,3501,3503,3505,3507,3509,3511,3513,3515,3517,3519,3521],{"class":489,"line":532},[487,3500,2345],{"class":500},[487,3502,2377],{"class":519},[487,3504,559],{"class":508},[487,3506,562],{"class":508},[487,3508,744],{"class":565},[487,3510,553],{"class":508},[487,3512,2388],{"class":519},[487,3514,793],{"class":508},[487,3516,754],{"class":565},[487,3518,553],{"class":508},[487,3520,1701],{"class":519},[487,3522,585],{"class":508},[487,3524,3525],{"class":489,"line":539},[487,3526,536],{"emptyLinePlaceholder":535},[487,3528,3529],{"class":489,"line":545},[487,3530,3531],{"class":493},"\u002F\u002F never changes the input, so frozen inputs work\n",[487,3533,3534,3536,3539,3541,3544,3546,3548,3550,3552],{"class":489,"line":588},[487,3535,501],{"class":500},[487,3537,3538],{"class":504}," removeUnknownKeys ",[487,3540,509],{"class":508},[487,3542,3543],{"class":512}," createRemoveUnknownKeysFn",[487,3545,516],{"class":508},[487,3547,722],{"class":519},[487,3549,523],{"class":508},[487,3551,526],{"class":504},[487,3553,529],{"class":508},[487,3555,3556],{"class":489,"line":605},[487,3557,536],{"emptyLinePlaceholder":535},[487,3559,3560,3562,3565,3567,3569,3571,3573,3575,3577,3579,3581,3583,3585,3587,3589,3592,3594,3596,3598,3601,3603,3605,3608,3610],{"class":489,"line":610},[487,3561,501],{"class":500},[487,3563,3564],{"class":504}," dirty ",[487,3566,509],{"class":508},[487,3568,562],{"class":508},[487,3570,744],{"class":565},[487,3572,553],{"class":508},[487,3574,749],{"class":571},[487,3576,575],{"class":508},[487,3578,754],{"class":565},[487,3580,553],{"class":508},[487,3582,759],{"class":508},[487,3584,763],{"class":762},[487,3586,766],{"class":508},[487,3588,575],{"class":508},[487,3590,3591],{"class":565}," admin",[487,3593,553],{"class":508},[487,3595,2447],{"class":2446},[487,3597,575],{"class":508},[487,3599,3600],{"class":565}," token",[487,3602,553],{"class":508},[487,3604,759],{"class":508},[487,3606,3607],{"class":762},"secret",[487,3609,766],{"class":508},[487,3611,585],{"class":508},[487,3613,3614,3616,3619,3621,3624,3627,3630,3632,3634,3636],{"class":489,"line":616},[487,3615,501],{"class":500},[487,3617,3618],{"class":504}," clean ",[487,3620,509],{"class":508},[487,3622,3623],{"class":512}," removeUnknownKeys",[487,3625,3626],{"class":504},"(dirty ",[487,3628,3629],{"class":890},"as",[487,3631,2377],{"class":519},[487,3633,672],{"class":504},[487,3635,793],{"class":508},[487,3637,3638],{"class":493}," \u002F\u002F {id: 1, name: 'Ada'}, new object\n",[487,3640,3641],{"class":489,"line":677},[487,3642,536],{"emptyLinePlaceholder":535},[487,3644,3645],{"class":489,"line":1818},[487,3646,3647],{"class":493},"\u002F\u002F validate untrusted data first, then drop its extra keys\n",[487,3649,3650,3652,3654,3656,3658,3660,3662,3664,3666],{"class":489,"line":1842},[487,3651,501],{"class":500},[487,3653,713],{"class":504},[487,3655,509],{"class":508},[487,3657,513],{"class":512},[487,3659,516],{"class":508},[487,3661,722],{"class":519},[487,3663,523],{"class":508},[487,3665,526],{"class":504},[487,3667,529],{"class":508},[487,3669,3670,3672,3674,3677,3679,3681,3683,3685,3687,3689],{"class":489,"line":1855},[487,3671,1680],{"class":890},[487,3673,1683],{"class":500},[487,3675,3676],{"class":512}," parseUser",[487,3678,635],{"class":508},[487,3680,875],{"class":874},[487,3682,553],{"class":508},[487,3684,880],{"class":519},[487,3686,1698],{"class":508},[487,3688,2377],{"class":519},[487,3690,885],{"class":508},[487,3692,3693,3695,3697,3700,3702,3704,3706,3708,3711,3714,3717,3719,3721,3724,3726,3728],{"class":489,"line":1868},[487,3694,891],{"class":890},[487,3696,894],{"class":565},[487,3698,3699],{"class":508},"!",[487,3701,737],{"class":512},[487,3703,635],{"class":565},[487,3705,875],{"class":504},[487,3707,903],{"class":565},[487,3709,3710],{"class":890},"throw",[487,3712,3713],{"class":508}," new",[487,3715,3716],{"class":512}," Error",[487,3718,635],{"class":565},[487,3720,766],{"class":508},[487,3722,3723],{"class":762},"not a User",[487,3725,766],{"class":508},[487,3727,672],{"class":565},[487,3729,529],{"class":508},[487,3731,3732,3734,3736,3738,3740,3742],{"class":489,"line":1876},[487,3733,2049],{"class":890},[487,3735,3623],{"class":512},[487,3737,635],{"class":565},[487,3739,875],{"class":504},[487,3741,672],{"class":565},[487,3743,529],{"class":508},[487,3745,3746],{"class":489,"line":1884},[487,3747,920],{"class":508},[487,3749,3750],{"class":489,"line":1898},[487,3751,536],{"emptyLinePlaceholder":535},[487,3753,3754],{"class":489,"line":1909},[487,3755,3756],{"class":493},"\u002F\u002F onClick is shared with the input: 'share' hides the warning, 'refuse' makes it a build error\n",[487,3758,3759,3761,3764,3766,3768,3770,3772,3774,3776,3779,3781,3784,3787,3790],{"class":489,"line":1930},[487,3760,2345],{"class":500},[487,3762,3763],{"class":519}," Button",[487,3765,559],{"class":508},[487,3767,562],{"class":508},[487,3769,1548],{"class":565},[487,3771,553],{"class":508},[487,3773,1701],{"class":519},[487,3775,793],{"class":508},[487,3777,3778],{"class":565}," onClick",[487,3780,553],{"class":508},[487,3782,3783],{"class":508}," ()",[487,3785,3786],{"class":500}," =>",[487,3788,3789],{"class":519}," void",[487,3791,585],{"class":508},[487,3793,3794,3796,3799,3801,3803,3805,3808,3810,3812,3814],{"class":489,"line":1942},[487,3795,501],{"class":500},[487,3797,3798],{"class":504}," removeButtonKeys ",[487,3800,509],{"class":508},[487,3802,3543],{"class":512},[487,3804,516],{"class":508},[487,3806,3807],{"class":519},"Button",[487,3809,523],{"class":508},[487,3811,635],{"class":504},[487,3813,2098],{"class":508},[487,3815,885],{"class":508},[487,3817,3818,3821,3823,3825,3828,3830],{"class":489,"line":1954},[487,3819,3820],{"class":565},"  sharedValues",[487,3822,553],{"class":508},[487,3824,759],{"class":508},[487,3826,3827],{"class":762},"share",[487,3829,766],{"class":508},[487,3831,2117],{"class":508},[487,3833,3834,3836,3838],{"class":489,"line":1961},[487,3835,669],{"class":508},[487,3837,672],{"class":504},[487,3839,529],{"class":508},[487,3841,3842],{"class":489,"line":1968},[487,3843,536],{"emptyLinePlaceholder":535},[487,3845,3846,3848,3850,3853,3855,3858,3860,3863],{"class":489,"line":1976},[487,3847,1680],{"class":890},[487,3849,562],{"class":508},[487,3851,3852],{"class":504},"removeUnknownKeys",[487,3854,575],{"class":508},[487,3856,3857],{"class":504}," clean",[487,3859,575],{"class":508},[487,3861,3862],{"class":504}," removeButtonKeys",[487,3864,585],{"class":508},[998,3866,3867,3877],{},[1001,3868,3869],{},[1004,3870,3871,3874],{},[1007,3872,3873],{},"Declared member",[1007,3875,3876],{},"On the copy",[1014,3878,3879,3887,3895,3903,3914],{},[1004,3880,3881,3884],{},[1019,3882,3883],{},"Data, Dates, Maps and Sets",[1019,3885,3886],{},"A new copy",[1004,3888,3889,3892],{},[1019,3890,3891],{},"Class instance",[1019,3893,3894],{},"A new object with the same prototype. The constructor does not run.",[1004,3896,3897,3900],{},[1019,3898,3899],{},"Class method or getter",[1019,3901,3902],{},"Still works, from the prototype",[1004,3904,3905,3911],{},[1019,3906,3907,3908],{},"Function, Promise, RegExp or a built-in like ",[409,3909,3910],{},"Int8Array",[1019,3912,3913],{},"The same value as the input, with a warning",[1004,3915,3916,3923],{},[1019,3917,3918,3919,3922],{},"Symbol-keyed property, or a class with ",[409,3920,3921],{},"#private"," fields",[1019,3924,3925],{},"Build error, the function always throws",[470,3927,3929],{"id":3928},"standard-schema-support","Standard Schema Support",[405,3931,3932,3935,3936,3942,3943,629],{},[409,3933,3934],{},"createStandardSchema\u003CT>()"," wraps the validators above in a ",[419,3937,3941],{"href":3938,"rel":3939},"https:\u002F\u002Fgithub.com\u002Fstandard-schema\u002Fstandard-schema",[3940],"nofollow","Standard Schema"," object that tRPC, TanStack Form and Router, Hono, React Hook Form and many more read directly, with no per-library adapter. It takes the same three call forms as every other factory and the same ",[409,3944,3945],{},"ValidateOptions",[478,3947,3949],{"className":480,"code":3948,"language":482,"meta":483,"style":483},"\u002F\u002F a Standard Schema v1 object: a single `~standard` property\nconst userSchema = createStandardSchema\u003CUser>();\n\n\u002F\u002F Valid input comes back under `value`.\nuserSchema['~standard'].validate({id: 1, name: 'Ada', roles: ['admin']});\n\u002F\u002F {value: {id: 1, name: 'Ada', roles: ['admin']}}\n\n\u002F\u002F Invalid input comes back as a flat list of issues, each with a message + path.\nuserSchema['~standard'].validate({id: '1', name: 'Ada', roles: ['admin']});\n\u002F\u002F {issues: [{message: 'Expected number', path: ['id']}]}\n",[409,3950,3951,3956,3978,3982,3987,4049,4054,4058,4063,4127],{"__ignoreMap":483},[487,3952,3953],{"class":489,"line":490},[487,3954,3955],{"class":493},"\u002F\u002F a Standard Schema v1 object: a single `~standard` property\n",[487,3957,3958,3960,3963,3965,3968,3970,3972,3974,3976],{"class":489,"line":497},[487,3959,501],{"class":500},[487,3961,3962],{"class":504}," userSchema ",[487,3964,509],{"class":508},[487,3966,3967],{"class":512}," createStandardSchema",[487,3969,516],{"class":508},[487,3971,722],{"class":519},[487,3973,523],{"class":508},[487,3975,526],{"class":504},[487,3977,529],{"class":508},[487,3979,3980],{"class":489,"line":532},[487,3981,536],{"emptyLinePlaceholder":535},[487,3983,3984],{"class":489,"line":539},[487,3985,3986],{"class":493},"\u002F\u002F Valid input comes back under `value`.\n",[487,3988,3989,3992,3994,3997,3999,4001,4003,4005,4007,4009,4011,4013,4015,4017,4019,4021,4023,4025,4027,4029,4031,4033,4035,4037,4039,4041,4043,4045,4047],{"class":489,"line":545},[487,3990,3991],{"class":504},"userSchema[",[487,3993,766],{"class":508},[487,3995,3996],{"class":762},"~standard",[487,3998,766],{"class":508},[487,4000,786],{"class":504},[487,4002,629],{"class":508},[487,4004,2244],{"class":512},[487,4006,635],{"class":504},[487,4008,638],{"class":508},[487,4010,744],{"class":565},[487,4012,553],{"class":508},[487,4014,749],{"class":571},[487,4016,575],{"class":508},[487,4018,754],{"class":565},[487,4020,553],{"class":508},[487,4022,759],{"class":508},[487,4024,763],{"class":762},[487,4026,766],{"class":508},[487,4028,575],{"class":508},[487,4030,771],{"class":565},[487,4032,553],{"class":508},[487,4034,776],{"class":504},[487,4036,766],{"class":508},[487,4038,781],{"class":762},[487,4040,766],{"class":508},[487,4042,786],{"class":504},[487,4044,669],{"class":508},[487,4046,672],{"class":504},[487,4048,529],{"class":508},[487,4050,4051],{"class":489,"line":588},[487,4052,4053],{"class":493},"\u002F\u002F {value: {id: 1, name: 'Ada', roles: ['admin']}}\n",[487,4055,4056],{"class":489,"line":605},[487,4057,536],{"emptyLinePlaceholder":535},[487,4059,4060],{"class":489,"line":610},[487,4061,4062],{"class":493},"\u002F\u002F Invalid input comes back as a flat list of issues, each with a message + path.\n",[487,4064,4065,4067,4069,4071,4073,4075,4077,4079,4081,4083,4085,4087,4089,4091,4093,4095,4097,4099,4101,4103,4105,4107,4109,4111,4113,4115,4117,4119,4121,4123,4125],{"class":489,"line":616},[487,4066,3991],{"class":504},[487,4068,766],{"class":508},[487,4070,3996],{"class":762},[487,4072,766],{"class":508},[487,4074,786],{"class":504},[487,4076,629],{"class":508},[487,4078,2244],{"class":512},[487,4080,635],{"class":504},[487,4082,638],{"class":508},[487,4084,744],{"class":565},[487,4086,553],{"class":508},[487,4088,759],{"class":508},[487,4090,813],{"class":762},[487,4092,766],{"class":508},[487,4094,575],{"class":508},[487,4096,754],{"class":565},[487,4098,553],{"class":508},[487,4100,759],{"class":508},[487,4102,763],{"class":762},[487,4104,766],{"class":508},[487,4106,575],{"class":508},[487,4108,771],{"class":565},[487,4110,553],{"class":508},[487,4112,776],{"class":504},[487,4114,766],{"class":508},[487,4116,781],{"class":762},[487,4118,766],{"class":508},[487,4120,786],{"class":504},[487,4122,669],{"class":508},[487,4124,672],{"class":504},[487,4126,529],{"class":508},[487,4128,4129],{"class":489,"line":677},[487,4130,4131],{"class":493},"\u002F\u002F {issues: [{message: 'Expected number', path: ['id']}]}\n",[432,4133,4134,4136,4137,4140,4141,4143],{},[409,4135,2244],{}," is synchronous and never throws on invalid input; it reports through ",[409,4138,4139],{},"issues",". The result is typed as ",[409,4142,447],{},", the serializable projection covered above.",[4145,4146,4147],"style",{},"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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}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 .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}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);}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}","Type guards and error reports generated from your type at build time.","md",null,{"toc":24},{"title":52,"description":4148},"5OvrEhiuagaqHJJqLu4tNlMaAsvsMrba5Ceh-mh01-s",1793324363741]