[{"data":1,"prerenderedAt":1511},["ShallowReactive",2],{"navigation_docs":3,"-runtypes-guide-mocking":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":205,"body":401,"description":1505,"extension":1506,"links":1507,"meta":1508,"navigation":507,"path":206,"seo":1509,"stem":207,"__hash__":1510},"docs\u002F02.runtypes\u002F02.guide\u002F07.mocking.md",{"type":402,"value":403},"minimark",[404,409,413,459,603,609,613,620,788,1105,1115,1118,1124,1190,1196,1212,1216,1223,1383,1389,1393,1404,1456,1459,1462,1496,1501],[405,406,408],"h2",{"id":407},"generating-mock-data","Generating Mock Data",[410,411,412],"p",{},"Mock generation has its own import, so an app that never uses it ships none of it. Change the type and the mocks follow.",[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 {createMockDataFn} from '@mionjs\u002Frun-types\u002Fmocking';\n","ts","",[421,422,423],"code",{"__ignoreMap":419},[424,425,428,432,436,440,443,446,449,453,456],"span",{"class":426,"line":427},"line",1,[424,429,431],{"class":430},"s7zQu","import",[424,433,435],{"class":434},"sMK4o"," {",[424,437,439],{"class":438},"sTEyZ","createMockDataFn",[424,441,442],{"class":434},"}",[424,444,445],{"class":430}," from",[424,447,448],{"class":434}," '",[424,450,452],{"class":451},"sfazB","@mionjs\u002Frun-types\u002Fmocking",[424,454,455],{"class":434},"'",[424,457,458],{"class":434},";\n",[414,460,462],{"className":416,"code":461,"language":418,"meta":419,"style":419},"\u002F\u002F a fresh, valid User on every call\nconst mockUser = createMockDataFn\u003CUser>();\n\nconst a = mockUser(); \u002F\u002F {id: 91, name: 'qZ...', roles: ['user'], active: true}\nconst b = mockUser(); \u002F\u002F a different one each time\n\n\u002F\u002F every mock passes the validator for its type\nconst isUser = createValidateFn\u003CUser>();\nisUser(mockUser()); \u002F\u002F true\n",[421,463,464,470,502,509,530,549,554,560,583],{"__ignoreMap":419},[424,465,466],{"class":426,"line":427},[424,467,469],{"class":468},"sHwdD","\u002F\u002F a fresh, valid User on every call\n",[424,471,473,477,480,483,487,490,494,497,500],{"class":426,"line":472},2,[424,474,476],{"class":475},"spNyl","const",[424,478,479],{"class":438}," mockUser ",[424,481,482],{"class":434},"=",[424,484,486],{"class":485},"s2Zo4"," createMockDataFn",[424,488,489],{"class":434},"\u003C",[424,491,493],{"class":492},"sBMFI","User",[424,495,496],{"class":434},">",[424,498,499],{"class":438},"()",[424,501,458],{"class":434},[424,503,505],{"class":426,"line":504},3,[424,506,508],{"emptyLinePlaceholder":507},true,"\n",[424,510,512,514,517,519,522,524,527],{"class":426,"line":511},4,[424,513,476],{"class":475},[424,515,516],{"class":438}," a ",[424,518,482],{"class":434},[424,520,521],{"class":485}," mockUser",[424,523,499],{"class":438},[424,525,526],{"class":434},";",[424,528,529],{"class":468}," \u002F\u002F {id: 91, name: 'qZ...', roles: ['user'], active: true}\n",[424,531,533,535,538,540,542,544,546],{"class":426,"line":532},5,[424,534,476],{"class":475},[424,536,537],{"class":438}," b ",[424,539,482],{"class":434},[424,541,521],{"class":485},[424,543,499],{"class":438},[424,545,526],{"class":434},[424,547,548],{"class":468}," \u002F\u002F a different one each time\n",[424,550,552],{"class":426,"line":551},6,[424,553,508],{"emptyLinePlaceholder":507},[424,555,557],{"class":426,"line":556},7,[424,558,559],{"class":468},"\u002F\u002F every mock passes the validator for its type\n",[424,561,563,565,568,570,573,575,577,579,581],{"class":426,"line":562},8,[424,564,476],{"class":475},[424,566,567],{"class":438}," isUser ",[424,569,482],{"class":434},[424,571,572],{"class":485}," createValidateFn",[424,574,489],{"class":434},[424,576,493],{"class":492},[424,578,496],{"class":434},[424,580,499],{"class":438},[424,582,458],{"class":434},[424,584,586,589,592,595,598,600],{"class":426,"line":585},9,[424,587,588],{"class":485},"isUser",[424,590,591],{"class":438},"(",[424,593,594],{"class":485},"mockUser",[424,596,597],{"class":438},"())",[424,599,526],{"class":434},[424,601,602],{"class":468}," \u002F\u002F true\n",[604,605,606,608],"note",{},[421,607,439],{}," needs the Vite plugin to read your type, and throws without it. Use it in tests and seed scripts, not in shipped code.",[405,610,612],{"id":611},"mock-options","Mock Options",[410,614,615,616,619],{},"Pass a ",[421,617,618],{},"mock"," options object to shape the generated values.",[414,621,623],{"className":416,"code":622,"language":418,"meta":419,"style":419},"\u002F\u002F factory options apply to every call; per-call options win (defaults \u003C factory \u003C call)\nconst mockAccount = createMockDataFn\u003CAccount>(undefined, {\n  mock: {\n    minNumber: 0,\n    maxNumber: 1000, \u002F\u002F numbers land in [0, 1000]\n    stringLength: 8, \u002F\u002F every generated string is 8 chars\n    optionalProbability: 1, \u002F\u002F always include optional props like `tags`\n  },\n});\n\nconst rich = mockAccount({mock: {minNumber: 1_000_000}}); \u002F\u002F override just for this call\n",[421,624,625,630,656,667,681,697,712,727,732,741,746],{"__ignoreMap":419},[424,626,627],{"class":426,"line":427},[424,628,629],{"class":468},"\u002F\u002F factory options apply to every call; per-call options win (defaults \u003C factory \u003C call)\n",[424,631,632,634,637,639,641,643,646,648,650,653],{"class":426,"line":472},[424,633,476],{"class":475},[424,635,636],{"class":438}," mockAccount ",[424,638,482],{"class":434},[424,640,486],{"class":485},[424,642,489],{"class":434},[424,644,645],{"class":492},"Account",[424,647,496],{"class":434},[424,649,591],{"class":438},[424,651,652],{"class":434},"undefined,",[424,654,655],{"class":434}," {\n",[424,657,658,662,665],{"class":426,"line":504},[424,659,661],{"class":660},"swJcz","  mock",[424,663,664],{"class":434},":",[424,666,655],{"class":434},[424,668,669,672,674,678],{"class":426,"line":511},[424,670,671],{"class":660},"    minNumber",[424,673,664],{"class":434},[424,675,677],{"class":676},"sbssI"," 0",[424,679,680],{"class":434},",\n",[424,682,683,686,688,691,694],{"class":426,"line":532},[424,684,685],{"class":660},"    maxNumber",[424,687,664],{"class":434},[424,689,690],{"class":676}," 1000",[424,692,693],{"class":434},",",[424,695,696],{"class":468}," \u002F\u002F numbers land in [0, 1000]\n",[424,698,699,702,704,707,709],{"class":426,"line":551},[424,700,701],{"class":660},"    stringLength",[424,703,664],{"class":434},[424,705,706],{"class":676}," 8",[424,708,693],{"class":434},[424,710,711],{"class":468}," \u002F\u002F every generated string is 8 chars\n",[424,713,714,717,719,722,724],{"class":426,"line":556},[424,715,716],{"class":660},"    optionalProbability",[424,718,664],{"class":434},[424,720,721],{"class":676}," 1",[424,723,693],{"class":434},[424,725,726],{"class":468}," \u002F\u002F always include optional props like `tags`\n",[424,728,729],{"class":426,"line":562},[424,730,731],{"class":434},"  },\n",[424,733,734,736,739],{"class":426,"line":585},[424,735,442],{"class":434},[424,737,738],{"class":438},")",[424,740,458],{"class":434},[424,742,744],{"class":426,"line":743},10,[424,745,508],{"emptyLinePlaceholder":507},[424,747,749,751,754,756,759,761,764,766,768,770,773,775,778,781,783,785],{"class":426,"line":748},11,[424,750,476],{"class":475},[424,752,753],{"class":438}," rich ",[424,755,482],{"class":434},[424,757,758],{"class":485}," mockAccount",[424,760,591],{"class":438},[424,762,763],{"class":434},"{",[424,765,618],{"class":660},[424,767,664],{"class":434},[424,769,435],{"class":434},[424,771,772],{"class":660},"minNumber",[424,774,664],{"class":434},[424,776,777],{"class":676}," 1_000_000",[424,779,780],{"class":434},"}}",[424,782,738],{"class":438},[424,784,526],{"class":434},[424,786,787],{"class":468}," \u002F\u002F override just for this call\n",[789,790,791,807],"table",{},[792,793,794],"thead",{},[795,796,797,801,804],"tr",{},[798,799,800],"th",{},"Group",[798,802,803],{},"Option",[798,805,806],{},"What it does",[808,809,810,827,842,854,877,896,917,933,952,970,985,998,1010,1022,1039,1054,1066,1088],"tbody",{},[795,811,812,816,824],{},[813,814,815],"td",{},"Ranges and lengths",[813,817,818,820,821],{},[421,819,772],{}," \u002F ",[421,822,823],{},"maxNumber",[813,825,826],{},"Inclusive bounds for generated numbers and bigints.",[795,828,829,831,839],{},[813,830,815],{},[813,832,833,820,836],{},[421,834,835],{},"stringLength",[421,837,838],{},"maxRandomStringLength",[813,840,841],{},"Force, or cap, generated string length.",[795,843,844,846,851],{},[813,845,815],{},[813,847,848],{},[421,849,850],{},"stringCharSet",[813,852,853],{},"The character set strings are built from.",[795,855,856,858,866],{},[813,857,815],{},[813,859,860,820,863],{},[421,861,862],{},"arrayLength",[421,864,865],{},"maxRandomItemsLength",[813,867,868,869,872,873,876],{},"Force, or cap, array, ",[421,870,871],{},"Map",", ",[421,874,875],{},"Set"," and record sizes. The cap shrinks at each nested level.",[795,878,879,881,889],{},[813,880,815],{},[813,882,883,820,886],{},[421,884,885],{},"minDate",[421,887,888],{},"maxDate",[813,890,891,892,895],{},"Inclusive bounds for generated dates (a timestamp or a ",[421,893,894],{},"Date",").",[795,897,898,901,906],{},[813,899,900],{},"Pools and pins",[813,902,903],{},[421,904,905],{},"anyValuesList",[813,907,908,909,912,913,916],{},"The pool the ",[421,910,911],{},"any"," and ",[421,914,915],{},"unknown"," kinds draw from.",[795,918,919,921,926],{},[813,920,900],{},[813,922,923],{},[421,924,925],{},"objectList",[813,927,928,929,932],{},"The pool the plain ",[421,930,931],{},"object"," kind draws from.",[795,934,935,937,942],{},[813,936,900],{},[813,938,939],{},[421,940,941],{},"regexpList",[813,943,908,944,947,948,951],{},[421,945,946],{},"RegExp"," kind draws from when ",[421,949,950],{},"nonDataTypes"," is on.",[795,953,954,956,967],{},[813,955,900],{},[813,957,958,820,961,820,964],{},[421,959,960],{},"symbolName",[421,962,963],{},"symbolLength",[421,965,966],{},"symbolCharSet",[813,968,969],{},"Fix a generated symbol's name, or its random length and character set.",[795,971,972,974,982],{},[813,973,900],{},[813,975,976,820,979],{},[421,977,978],{},"unionIndex",[421,980,981],{},"enumIndex",[813,983,984],{},"Pin a union member or enum branch instead of picking at random.",[795,986,987,990,995],{},[813,988,989],{},"Optionality and recursion",[813,991,992],{},[421,993,994],{},"optionalProbability",[813,996,997],{},"Chance from 0 to 1 that an optional property is included.",[795,999,1000,1002,1007],{},[813,1001,989],{},[813,1003,1004],{},[421,1005,1006],{},"optionalPropertyProbability",[813,1008,1009],{},"Per-property override of that chance, keyed by property name.",[795,1011,1012,1014,1019],{},[813,1013,989],{},[813,1015,1016],{},[421,1017,1018],{},"maxMockRecursion",[813,1020,1021],{},"How far a recursive type is followed before it bottoms out.",[795,1023,1024,1027,1032],{},[813,1025,1026],{},"Promises",[813,1028,1029],{},[421,1030,1031],{},"promiseTimeOut",[813,1033,1034,1035,1038],{},"Delay in milliseconds before a mocked ",[421,1036,1037],{},"Promise"," resolves (0 resolves immediately).",[795,1040,1041,1043,1048],{},[813,1042,1026],{},[813,1044,1045],{},[421,1046,1047],{},"promiseReject",[813,1049,1050,1051,1053],{},"When set, the mocked ",[421,1052,1037],{}," rejects with this value instead of resolving.",[795,1055,1056,1059,1063],{},[813,1057,1058],{},"Advanced",[813,1060,1061],{},[421,1062,950],{},[813,1064,1065],{},"Also generate the non-data members (functions, methods, symbols, non-serializable natives) a mock normally leaves out. Off by default.",[795,1067,1068,1070,1078],{},[813,1069,1058],{},[813,1071,1072,820,1075],{},[421,1073,1074],{},"tupleOptions",[421,1076,1077],{},"paramsOptions",[813,1079,1080,1081,1083,1084,1087],{},"Per-slot options for a tuple's elements. ",[421,1082,1077],{}," is an alias that also covers a function's ",[421,1085,1086],{},"Parameters\u003Ctypeof fn>",".",[795,1089,1090,1092,1097],{},[813,1091,1058],{},[813,1093,1094],{},[421,1095,1096],{},"seed",[813,1098,1099,1100,1087],{},"Fix the random source. See ",[1101,1102,1104],"a",{"href":1103},"#seeding-data","Seeding Data",[410,1106,1107,1108,1111,1112,1114],{},"For realistic values (real names, your own domains, sensible ranges), use the ",[421,1109,1110],{},"data"," enrichment map on the ",[1101,1113,283],{"href":284}," page.",[405,1116,1104],{"id":1117},"seeding-data",[410,1119,1120,1121,1123],{},"By default every call returns fresh random data. Pass a ",[421,1122,1096],{}," and the same seed always produces the same value, for every type.",[414,1125,1127],{"className":416,"code":1126,"language":418,"meta":419,"style":419},"const mockFixture = createMockDataFn\u003CAccount>(undefined, {mock: {seed: 123}});\nconst sameEveryRun = mockFixture(); \u002F\u002F identical on every run\n",[421,1128,1129,1171],{"__ignoreMap":419},[424,1130,1131,1133,1136,1138,1140,1142,1144,1146,1148,1150,1152,1154,1156,1158,1160,1162,1165,1167,1169],{"class":426,"line":427},[424,1132,476],{"class":475},[424,1134,1135],{"class":438}," mockFixture ",[424,1137,482],{"class":434},[424,1139,486],{"class":485},[424,1141,489],{"class":434},[424,1143,645],{"class":492},[424,1145,496],{"class":434},[424,1147,591],{"class":438},[424,1149,652],{"class":434},[424,1151,435],{"class":434},[424,1153,618],{"class":660},[424,1155,664],{"class":434},[424,1157,435],{"class":434},[424,1159,1096],{"class":660},[424,1161,664],{"class":434},[424,1163,1164],{"class":676}," 123",[424,1166,780],{"class":434},[424,1168,738],{"class":438},[424,1170,458],{"class":434},[424,1172,1173,1175,1178,1180,1183,1185,1187],{"class":426,"line":472},[424,1174,476],{"class":475},[424,1176,1177],{"class":438}," sameEveryRun ",[424,1179,482],{"class":434},[424,1181,1182],{"class":485}," mockFixture",[424,1184,499],{"class":438},[424,1186,526],{"class":434},[424,1188,1189],{"class":468}," \u002F\u002F identical on every run\n",[410,1191,1192,1193,1195],{},"Time-based values (",[421,1194,894],{},", Temporal, uuid v7) are seeded too: they start from a fixed instant, not the clock, so they still vary but stay the same on every run.",[410,1197,1198,1199,1202,1203,1207,1208,1211],{},"The build also reads a literal seed where the mock is created (",[421,1200,1201],{},"createMockDataFn\u003CT>(undefined, {mock: {seed: 42}})","). It seeds the value pools of ",[1101,1204,1206],{"href":1205},"\u002Fruntypes\u002Ftype-formats\u002Fstring#regex-patterns","pattern"," fields with no ",[421,1209,1210],{},"mockSamples",", so pattern mocks stay identical across rebuilds. Without a literal seed those pools change on every build; a computed or per-call seed still makes the picks repeat within one build.",[405,1213,1215],{"id":1214},"generating-invalid-data","Generating Invalid Data",[410,1217,1218,1219,1222],{},"Set ",[421,1220,1221],{},"invalid: true"," to get a value that fails validation: a valid value with one field replaced by a value of the wrong type. Use it to test your validators, decoders and error handling.",[414,1224,1226],{"className":416,"code":1225,"language":418,"meta":419,"style":419},"\u002F\u002F every User this returns fails the validator\nconst mockBadUser = createMockDataFn\u003CUser>(undefined, {mock: {invalid: true}});\n\nconst isUser = createValidateFn\u003CUser>();\nisUser(mockBadUser()); \u002F\u002F false  (e.g. {id: 7, email: 12345, role: 'editor', active: true})\n\n\u002F\u002F 1 always breaks a single deep field instead of the whole value\nconst mockBadField = createMockDataFn\u003CUser>(undefined, {\n  mock: {invalid: true, invalidLeafProbability: 1},\n});\n",[421,1227,1228,1233,1277,1281,1301,1317,1321,1326,1349,1375],{"__ignoreMap":419},[424,1229,1230],{"class":426,"line":427},[424,1231,1232],{"class":468},"\u002F\u002F every User this returns fails the validator\n",[424,1234,1235,1237,1240,1242,1244,1246,1248,1250,1252,1254,1256,1258,1260,1262,1265,1267,1271,1273,1275],{"class":426,"line":472},[424,1236,476],{"class":475},[424,1238,1239],{"class":438}," mockBadUser ",[424,1241,482],{"class":434},[424,1243,486],{"class":485},[424,1245,489],{"class":434},[424,1247,493],{"class":492},[424,1249,496],{"class":434},[424,1251,591],{"class":438},[424,1253,652],{"class":434},[424,1255,435],{"class":434},[424,1257,618],{"class":660},[424,1259,664],{"class":434},[424,1261,435],{"class":434},[424,1263,1264],{"class":660},"invalid",[424,1266,664],{"class":434},[424,1268,1270],{"class":1269},"sfNiH"," true",[424,1272,780],{"class":434},[424,1274,738],{"class":438},[424,1276,458],{"class":434},[424,1278,1279],{"class":426,"line":504},[424,1280,508],{"emptyLinePlaceholder":507},[424,1282,1283,1285,1287,1289,1291,1293,1295,1297,1299],{"class":426,"line":511},[424,1284,476],{"class":475},[424,1286,567],{"class":438},[424,1288,482],{"class":434},[424,1290,572],{"class":485},[424,1292,489],{"class":434},[424,1294,493],{"class":492},[424,1296,496],{"class":434},[424,1298,499],{"class":438},[424,1300,458],{"class":434},[424,1302,1303,1305,1307,1310,1312,1314],{"class":426,"line":532},[424,1304,588],{"class":485},[424,1306,591],{"class":438},[424,1308,1309],{"class":485},"mockBadUser",[424,1311,597],{"class":438},[424,1313,526],{"class":434},[424,1315,1316],{"class":468}," \u002F\u002F false  (e.g. {id: 7, email: 12345, role: 'editor', active: true})\n",[424,1318,1319],{"class":426,"line":551},[424,1320,508],{"emptyLinePlaceholder":507},[424,1322,1323],{"class":426,"line":556},[424,1324,1325],{"class":468},"\u002F\u002F 1 always breaks a single deep field instead of the whole value\n",[424,1327,1328,1330,1333,1335,1337,1339,1341,1343,1345,1347],{"class":426,"line":562},[424,1329,476],{"class":475},[424,1331,1332],{"class":438}," mockBadField ",[424,1334,482],{"class":434},[424,1336,486],{"class":485},[424,1338,489],{"class":434},[424,1340,493],{"class":492},[424,1342,496],{"class":434},[424,1344,591],{"class":438},[424,1346,652],{"class":434},[424,1348,655],{"class":434},[424,1350,1351,1353,1355,1357,1359,1361,1363,1365,1368,1370,1372],{"class":426,"line":585},[424,1352,661],{"class":660},[424,1354,664],{"class":434},[424,1356,435],{"class":434},[424,1358,1264],{"class":660},[424,1360,664],{"class":434},[424,1362,1270],{"class":1269},[424,1364,693],{"class":434},[424,1366,1367],{"class":660}," invalidLeafProbability",[424,1369,664],{"class":434},[424,1371,721],{"class":676},[424,1373,1374],{"class":434},"},\n",[424,1376,1377,1379,1381],{"class":426,"line":743},[424,1378,442],{"class":434},[424,1380,738],{"class":438},[424,1382,458],{"class":434},[410,1384,1385,1388],{},[421,1386,1387],{},"invalidLeafProbability"," (0 to 1) sets how deep the bad value lands: the whole value, a nested object or array, or a leaf. Near the default of 0.85 it breaks a single deep field. Lower it and the break moves outward; at 0 it always replaces the whole value.",[405,1390,1392],{"id":1391},"format-aware-mocks","Format-Aware Mocks",[410,1394,1395,1396,1399,1400,1403],{},"Mocks respect ",[1101,1397,1398],{"href":227},"type formats",": an ",[421,1401,1402],{},"email"," field gets a real-looking address, not random characters.",[414,1405,1407],{"className":416,"code":1406,"language":418,"meta":419,"style":419},"const mockContact = createMockDataFn\u003CContact>();\n\nconst fake = mockContact();\n\u002F\u002F {id: '3f2504e0-4f89-...', email: 'name@example.com', name: '...'}\n",[421,1408,1409,1431,1435,1451],{"__ignoreMap":419},[424,1410,1411,1413,1416,1418,1420,1422,1425,1427,1429],{"class":426,"line":427},[424,1412,476],{"class":475},[424,1414,1415],{"class":438}," mockContact ",[424,1417,482],{"class":434},[424,1419,486],{"class":485},[424,1421,489],{"class":434},[424,1423,1424],{"class":492},"Contact",[424,1426,496],{"class":434},[424,1428,499],{"class":438},[424,1430,458],{"class":434},[424,1432,1433],{"class":426,"line":472},[424,1434,508],{"emptyLinePlaceholder":507},[424,1436,1437,1439,1442,1444,1447,1449],{"class":426,"line":504},[424,1438,476],{"class":475},[424,1440,1441],{"class":438}," fake ",[424,1443,482],{"class":434},[424,1445,1446],{"class":485}," mockContact",[424,1448,499],{"class":438},[424,1450,458],{"class":434},[424,1452,1453],{"class":426,"line":511},[424,1454,1455],{"class":468},"\u002F\u002F {id: '3f2504e0-4f89-...', email: 'name@example.com', name: '...'}\n",[410,1457,1458],{},"A mock always passes the type's own validator, format checks included. When it cannot (say every sample for a custom pattern breaks the declared length bounds), the mock function throws an error naming the problem.",[410,1460,1461],{},"More format behaviour:",[1463,1464,1465,1473,1482,1493],"ul",{},[1466,1467,1468,1469,1472],"li",{},"A format restricted to a fixed set with ",[421,1470,1471],{},"allowedValues"," (the domain formats included) mocks from that set.",[1466,1474,1475,1476,1478,1479,1481],{},"A custom ",[421,1477,1206],{}," mocks from its ",[421,1480,1210],{},", or from a pool the build generates from the regex when you declare none.",[1466,1483,1484,1485,1488,1489,1492],{},"A format's ",[421,1486,1487],{},"transform"," (like ",[421,1490,1491],{},"TF.Lowercase",") is applied to the mock.",[1466,1494,1495],{},"Two formats that differ only in their mock samples share one compiled entry, so declaring two different sample pools for them is a build error (format-sample-conflict).",[410,1497,1498,1500],{},[1101,1499,225],{"href":227}," lists every format and how it mocks.",[1502,1503,1504],"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 .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 .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 .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 pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}","Generate valid or invalid type-shaped fake data for tests and fixtures.","md",null,{"toc":24},{"title":205,"description":1505},"7P12roCfxyRStLtKyZliroYNbNVq5rxt5BJ1Jj7wI38",1793324363741]