[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"quiz-weekly-typescript-utility-types":3,"verticals":25,"search-suggestions":60,"quiz-article-weekly-typescript-utility-types":109,"path-membership-weekly-typescript-utility-types":601},{"id":4,"slug":5,"kind":6,"title":7,"description":8,"config":9,"verticalId":17,"vertical":18,"course":11,"_count":21,"access":22,"attempts":24,"questionCount":10},"01a1df1b-1e55-7189-9ee6-f61ce09e5895","weekly-typescript-utility-types","PRACTICE_QUIZ","TypeScript Utility Types","Test what you just learned about Partial, Pick, Omit, Record, the conditional-type utilities, and the union-type gotcha that trips up Omit.",{"questionCount":10,"timeLimitSec":11,"shuffleQuestions":12,"shuffleOptions":13,"negativeMarking":14,"passScorePct":15,"maxAttempts":11,"revealAnswers":16,"allowFlagging":12,"allowBacktracking":13},8,null,false,true,0,70,"AFTER_SUBMIT","019fe637-3d33-714b-b57f-23e163ffca0c",{"slug":19,"name":20},"dev","Web Development",{"questions":10},{"allowed":13,"reason":23},"FREE",[],[26,36,48],{"id":17,"slug":19,"name":20,"tagline":27,"description":28,"accentFrom":29,"accentTo":30,"icon":31,"defaultLocale":32,"locales":33,"features":35,"position":14},"Read it. Run it. Prove it.","A post a day on modern web development — most with an editable playground and a quiz that explains every answer. Free, no account needed.","violet-500","cyan-400","◇","en",[32,34],"fa",{"courses":13,"paths":13,"articles":13,"exams":12,"flashcards":12,"packages":13,"community":13,"certificates":13,"teams":13,"commerce":13},{"id":37,"slug":38,"name":39,"tagline":40,"description":41,"accentFrom":42,"accentTo":29,"icon":43,"defaultLocale":32,"locales":44,"features":46,"position":47},"019fe637-3dc2-754c-8657-0f175bfee7c6","lang","Languages","Learn a language the way you learn a codebase.","Grammar explained the way good documentation explains an API — one idea at a time, each with a quiz.","amber-400","⌘",[32,34,45],"es",{"courses":12,"paths":12,"articles":13,"exams":12,"flashcards":13,"packages":12,"community":13,"certificates":13,"teams":12,"commerce":12},2,{"id":49,"slug":50,"name":51,"tagline":52,"description":53,"accentFrom":54,"accentTo":55,"icon":56,"defaultLocale":32,"locales":57,"features":58,"position":59},"7b3c16f2-931d-410e-802e-e1fa4edab7de","soft","Soft Skills","The half of the job nobody wrote documentation for.","Weekly, on the parts of working life that decide more than your code does — first weeks, meetings, interviews, promotions, and the people around you. Written from what actually happens, and recorded as a podcast you can listen to on the walk.","emerald-400","teal-300","◉",[32],{"courses":12,"paths":12,"articles":13,"exams":12,"flashcards":12,"packages":12,"community":13,"certificates":12,"teams":12,"commerce":12},3,[61,65,69,73,77,81,85,89,93,97,101,105],{"slug":62,"name":63,"articles":64},"webdev","Webdev",195,{"slug":66,"name":67,"articles":68},"javascript","Javascript",156,{"slug":70,"name":71,"articles":72},"frontend","Frontend",103,{"slug":74,"name":75,"articles":76},"tutorial","Tutorial",85,{"slug":78,"name":79,"articles":80},"css","Css",56,{"slug":82,"name":83,"articles":84},"typescript","Typescript",36,{"slug":86,"name":87,"articles":88},"performance","Performance",33,{"slug":90,"name":91,"articles":92},"programming","Programming",26,{"slug":94,"name":95,"articles":96},"react","React",23,{"slug":98,"name":99,"articles":100},"node","Node",19,{"slug":102,"name":103,"articles":104},"browser","Browser",18,{"slug":106,"name":107,"articles":108},"nextjs","Nextjs",13,{"id":110,"slug":5,"title":111,"subtitle":11,"excerpt":112,"coverUrl":113,"locale":32,"readingMinutes":114,"publishedAt":115,"viewCount":116,"likeCount":14,"commentCount":14,"author":117,"vertical":122,"topic":123,"tags":125,"_count":130,"playground":132,"body":134,"bodyMd":550,"seo":551,"translationGroupId":553,"series":554,"podcastUrl":11,"verticalId":17,"thread":592,"assessments":594,"translations":597,"quiz":599},"01a1df1b-1e04-73b8-9561-5b7b2459f738","TypeScript Utility Types: The Complete Guide","Learn TypeScript utility types — Partial, Pick, Omit, Record, Exclude, ReturnType — and the mapped types behind them, plus a copy-paste cheat sheet.","\u002Fmedia\u002Fcovers\u002Fweekly-typescript-utility-types.png",15,"2026-11-27T11:41:53.859Z",12,{"id":118,"name":119,"username":120,"avatarUrl":11,"headline":121},"019fe637-3c25-7088-9034-39c9f15dc3c8","Parsa Jiravand","parsa","Frontend engineer · building bestpractic",{"slug":19,"name":20,"accentFrom":29,"accentTo":30},{"slug":82,"name":124},"TypeScript",[126,127,128,129],{"slug":82,"name":83,"color":11},{"slug":66,"name":67,"color":11},{"slug":74,"name":75,"color":11},{"slug":62,"name":63,"color":11},{"assessments":131},1,{"slug":5,"title":133},"TypeScript utility types — interactive playground",{"blocks":135,"version":131},[136,140,145,148,157,160,163,177,180,183,189,192,195,199,202,205,208,211,215,218,221,225,228,232,235,239,242,245,249,252,256,259,263,266,269,273,276,279,283,286,289,292,295,298,301,304,307,311,314,317,321,324,327,331,334,337,340,344,347,350,353,357,360,363,367,370,373,376,379,382,385,388,392,395,399,402,406,409,413,416,420,423,426,485,489,492,495,498,501,504,507,514,517,520,523,526,532,535,538,541,544],{"id":137,"html":138,"type":139},"b1","\u003Cp>You add a field to your \u003Ccode>User\u003C\u002Fcode> interface. Somewhere three files away, a hand-written \u003Ccode>UpdateUserInput\u003C\u002Fcode> type — built the week before by copying \u003Ccode>User\u003C\u002Fcode> and manually marking six fields optional — doesn&#39;t get the memo. It still compiles. It&#39;s just wrong, and nothing tells you until a form silently drops the new field at runtime.\u003C\u002Fp>","paragraph",{"id":141,"html":142,"text":143,"type":144,"level":47},"b2","What you&#39;ll learn","What you'll learn","heading",{"id":146,"html":147,"type":139},"b3","\u003Cp>By the end of this guide you&#39;ll be able to:\u003C\u002Fp>",{"id":149,"type":150,"items":151,"ordered":12},"b4","list",[152,153,154,155,156],"Explain what a utility type actually is under the hood — not a special compiler feature, just a mapped or conditional type someone wrote once","Use \u003Ccode>Partial\u003C\u002Fcode>, \u003Ccode>Required\u003C\u002Fcode>, \u003Ccode>Readonly\u003C\u002Fcode>, \u003Ccode>Pick\u003C\u002Fcode>, \u003Ccode>Omit\u003C\u002Fcode>, and \u003Ccode>Record\u003C\u002Fcode> correctly, including the shallow-ness that trips people up","Use \u003Ccode>Exclude\u003C\u002Fcode>, \u003Ccode>Extract\u003C\u002Fcode>, \u003Ccode>NonNullable\u003C\u002Fcode>, \u003Ccode>ReturnType\u003C\u002Fcode>, \u003Ccode>Parameters\u003C\u002Fcode>, and \u003Ccode>Awaited\u003C\u002Fcode> to derive types from other types instead of hand-writing them","Recognize why \u003Ccode>Omit\u003C\u002Fcode> silently drops fields on a union type, and fix it with a two-line distributive version","Decide when reaching for a built-in utility type is the right call, and when a hand-written type is clearer",{"id":158,"html":159,"type":139},"b5","\u003Cp>\u003Cstrong>Who this is for:\u003C\u002Fstrong> you&#39;ve written interfaces, functions, and generics in TypeScript, and you&#39;ve used \u003Ccode>Partial&lt;T&gt;\u003C\u002Fcode> or \u003Ccode>Omit&lt;T, K&gt;\u003C\u002Fcode> without being totally sure what they expand to.\u003C\u002Fp>",{"id":161,"html":162,"text":162,"type":144,"level":47},"b6","Contents",{"id":164,"type":150,"items":165,"ordered":12},"b7",[166,167,168,169,170,171,172,173,174,175,176],"\u003Ca href=\"#why-utility-types-exist\">Why utility types exist\u003C\u002Fa>","\u003Ca href=\"#the-mental-model-utility-types-are-just-mapped-and-conditional-types\">The mental model\u003C\u002Fa>","\u003Ca href=\"#stage-1-the-modifier-types-partial-required-readonly\">Stage 1: the modifier types — Partial, Required, Readonly\u003C\u002Fa>","\u003Ca href=\"#stage-2-the-key-selection-types-pick-omit-record\">Stage 2: the key-selection types — Pick, Omit, Record\u003C\u002Fa>","\u003Ca href=\"#stage-3-the-conditional-types-exclude-extract-nonnullable\">Stage 3: the conditional types — Exclude, Extract, NonNullable\u003C\u002Fa>","\u003Ca href=\"#stage-4-the-introspection-types-returntype-parameters-awaited\">Stage 4: the introspection types — ReturnType, Parameters, Awaited\u003C\u002Fa>","\u003Ca href=\"#edge-cases-and-gotchas\">Edge cases and gotchas\u003C\u002Fa>","\u003Ca href=\"#best-practices\">Best practices\u003C\u002Fa>","\u003Ca href=\"#faq\">FAQ\u003C\u002Fa>","\u003Ca href=\"#cheat-sheet\">Cheat sheet\u003C\u002Fa>","\u003Ca href=\"#key-takeaways\">Key takeaways\u003C\u002Fa>",{"id":178,"html":179,"text":179,"type":144,"level":47},"b8","Why utility types exist",{"id":181,"html":182,"type":139},"b9","\u003Cp>Here&#39;s the naïve version of the opening story, written out:\u003C\u002Fp>",{"id":184,"code":185,"type":186,"language":187,"highlight":188},"b10","interface User {\n  id: string;\n  name: string;\n  email: string;\n  role: \"admin\" | \"member\";\n}\n\n\u002F\u002F hand-written, copy-pasted from User the week before this field existed\ninterface UpdateUserInput {\n  name?: string;\n  email?: string;\n  role?: \"admin\" | \"member\";\n  \u002F\u002F id intentionally left off — you don't update the id\n  \u002F\u002F ...and whatever gets added to User next just won't show up here\n}","code","ts",[],{"id":190,"html":191,"type":139},"b11","\u003Cp>\u003Ccode>UpdateUserInput\u003C\u002Fcode> isn&#39;t connected to \u003Ccode>User\u003C\u002Fcode> in any way the compiler can see. It&#39;s a second, independent type that happens to look similar today. Add \u003Ccode>avatarUrl\u003C\u002Fcode> to \u003Ccode>User\u003C\u002Fcode> and \u003Ccode>UpdateUserInput\u003C\u002Fcode> has no idea — it keeps compiling, keeps passing review, and keeps being wrong.\u003C\u002Fp>",{"id":193,"html":194,"type":139},"b12","\u003Cp>The fix is to \u003Cstrong>derive\u003C\u002Fstrong> the new type from the old one instead of retyping it:\u003C\u002Fp>",{"id":196,"code":197,"type":186,"language":187,"highlight":198},"b13","type UpdateUserInput = Partial\u003COmit\u003CUser, \"id\">>;\n\u002F\u002F { name?: string; email?: string; role?: (\"admin\" | \"member\") | undefined }",[],{"id":200,"html":201,"type":139},"b14","\u003Cp>Now \u003Ccode>UpdateUserInput\u003C\u002Fcode> is a \u003Cem>computation\u003C\u002Fem> over \u003Ccode>User\u003C\u002Fcode>, not a copy of it. Add \u003Ccode>avatarUrl\u003C\u002Fcode> to \u003Ccode>User\u003C\u002Fcode> and \u003Ccode>UpdateUserInput\u003C\u002Fcode> picks it up automatically, still optional, still without \u003Ccode>id\u003C\u002Fcode>. \u003Ccode>Partial\u003C\u002Fcode> and \u003Ccode>Omit\u003C\u002Fcode> are the two utility types doing that work — and they ship with TypeScript&#39;s standard library, in \u003Ccode>lib.es5.d.ts\u003C\u002Fcode>, as plain type aliases you could have written yourself.\u003C\u002Fp>",{"id":203,"html":204,"text":204,"type":144,"level":47},"b15","The mental model: utility types are just mapped and conditional types",{"id":206,"html":207,"type":139},"b16","\u003Cp>\u003Cstrong>The mental model:\u003C\u002Fstrong> a utility type is not a compiler feature — it&#39;s an ordinary generic type alias, built from two tools you already have: a \u003Cstrong>mapped type\u003C\u002Fstrong> (loop over a type&#39;s keys and transform each property) and a \u003Cstrong>conditional type\u003C\u002Fstrong> (branch on whether one type is assignable to another). TypeScript ships about twenty of these pre-written so you don&#39;t retype them, but nothing stops you from writing your own.\u003C\u002Fp>",{"id":209,"html":210,"type":139},"b17","\u003Cp>Here&#39;s \u003Ccode>Partial&lt;T&gt;\u003C\u002Fcode> in full — this is close to its real definition in \u003Ccode>lib.es5.d.ts\u003C\u002Fcode>:\u003C\u002Fp>",{"id":212,"code":213,"type":186,"language":187,"highlight":214},"b18","type MyPartial\u003CT> = {\n  [K in keyof T]?: T[K];\n};",[],{"id":216,"html":217,"type":139},"b19","\u003Cp>Read it like a \u003Ccode>for...in\u003C\u002Fcode> loop over types: \u003Ccode>K in keyof T\u003C\u002Fcode> walks every key of \u003Ccode>T\u003C\u002Fcode>; \u003Ccode>?:\u003C\u002Fcode> adds the optional modifier to each one; \u003Ccode>T[K]\u003C\u002Fcode> keeps that property&#39;s original type. That&#39;s the entire mechanism. \u003Ccode>Required&lt;T&gt;\u003C\u002Fcode> is the same loop with \u003Ccode>-?\u003C\u002Fcode> (remove the optional modifier) instead of \u003Ccode>?\u003C\u002Fcode>. \u003Ccode>Readonly&lt;T&gt;\u003C\u002Fcode> is the same loop with \u003Ccode>readonly\u003C\u002Fcode> added. Three &quot;different&quot; utility types, one template, one character changed each time.\u003C\u002Fp>",{"id":219,"html":220,"type":139},"b20","\u003Cp>\u003Ccode>Pick\u003C\u002Fcode> and \u003Ccode>Omit\u003C\u002Fcode> use the same mapped-type loop, but over a narrower or computed set of keys instead of all of \u003Ccode>keyof T\u003C\u002Fcode>:\u003C\u002Fp>",{"id":222,"code":223,"type":186,"language":187,"highlight":224},"b21","type MyPick\u003CT, K extends keyof T> = {\n  [P in K]: T[P];\n};\n\ntype MyOmit\u003CT, K extends keyof any> = MyPick\u003CT, Exclude\u003Ckeyof T, K>>;",[],{"id":226,"html":227,"type":139},"b22","\u003Cp>\u003Ccode>Omit\u003C\u002Fcode> isn&#39;t its own primitive — it&#39;s \u003Ccode>Pick\u003C\u002Fcode> over &quot;every key except these,&quot; and &quot;every key except these&quot; is \u003Ccode>Exclude\u003C\u002Fcode>, a \u003Cstrong>conditional type\u003C\u002Fstrong>:\u003C\u002Fp>",{"id":229,"code":230,"type":186,"language":187,"highlight":231},"b23","type MyExclude\u003CT, U> = T extends U ? never : T;",[],{"id":233,"html":234,"type":139},"b24","\u003Cp>Read that as: for each member of \u003Ccode>T\u003C\u002Fcode>, if it&#39;s assignable to \u003Ccode>U\u003C\u002Fcode>, replace it with \u003Ccode>never\u003C\u002Fcode> (which then vanishes from a union); otherwise keep it. This single four-word conditional is the engine behind \u003Ccode>Exclude\u003C\u002Fcode>, \u003Ccode>Extract\u003C\u002Fcode>, and — as you&#39;ll see in the edge cases section — the reason \u003Ccode>Omit\u003C\u002Fcode> behaves unexpectedly on union types.\u003C\u002Fp>",{"id":236,"html":237,"type":238},"b25","\u003Cp>\u003Cstrong>Key concept:\u003C\u002Fstrong> once you can read \u003Ccode>[K in keyof T]\u003C\u002Fcode> as &quot;loop over keys&quot; and \u003Ccode>T extends U ? X : Y\u003C\u002Fcode> as &quot;branch on assignability,&quot; every utility type in the standard library is legible on sight. You&#39;re not memorizing twenty names — you&#39;re applying two patterns.\u003C\u002Fp>\n","quote",{"id":240,"html":241,"text":241,"type":144,"level":47},"b26","Stage 1: the modifier types — Partial, Required, Readonly",{"id":243,"html":244,"type":139},"b27","\u003Cp>These three change \u003Cem>which modifiers\u003C\u002Fem> apply to every property, without touching which properties exist.\u003C\u002Fp>",{"id":246,"code":247,"type":186,"language":187,"highlight":248},"b28","interface Config {\n  host: string;\n  port: number;\n  debug?: boolean;\n}\n\ntype PartialConfig = Partial\u003CConfig>;\n\u002F\u002F { host?: string; port?: number; debug?: boolean }\n\ntype RequiredConfig = Required\u003CConfig>;\n\u002F\u002F { host: string; port: number; debug: boolean }  — debug's \"?\" is gone\n\ntype ReadonlyConfig = Readonly\u003CConfig>;\n\u002F\u002F { readonly host: string; readonly port: number; readonly debug?: boolean }",[],{"id":250,"html":251,"type":139},"b29","\u003Cp>\u003Ccode>Partial\u003C\u002Fcode> is the one you reach for constantly: update payloads, form state before every field is filled in, default-merging (\u003Ccode>{ ...defaults, ...overrides }\u003C\u002Fcode> where \u003Ccode>overrides: Partial&lt;Config&gt;\u003C\u002Fcode>). \u003Ccode>Required\u003C\u002Fcode> is its mirror — useful for asserting that, after validation, every optional field has in fact been filled:\u003C\u002Fp>",{"id":253,"code":254,"type":186,"language":187,"highlight":255},"b30","function startServer(config: Required\u003CConfig>) {\n  \u002F\u002F debug is guaranteed defined here — the compiler enforces it at the call site\n}",[],{"id":257,"html":258,"type":139},"b31","\u003Cp>\u003Ccode>Readonly\u003C\u002Fcode> prevents reassignment of top-level properties:\u003C\u002Fp>",{"id":260,"code":261,"type":186,"language":187,"highlight":262},"b32","const c: Readonly\u003CConfig> = { host: \"localhost\", port: 3000 };\nc.port = 4000; \u002F\u002F Error: Cannot assign to 'port' because it is a read-only property.",[],{"id":264,"html":265,"text":265,"type":144,"level":47},"b33","Stage 2: the key-selection types — Pick, Omit, Record",{"id":267,"html":268,"type":139},"b34","\u003Cp>These change \u003Cem>which properties exist\u003C\u002Fem>, keeping their original modifiers and types.\u003C\u002Fp>",{"id":270,"code":271,"type":186,"language":187,"highlight":272},"b35","interface User {\n  id: string;\n  name: string;\n  email: string;\n  role: \"admin\" | \"member\";\n}\n\ntype PublicUser = Pick\u003CUser, \"id\" | \"name\">;\n\u002F\u002F { id: string; name: string }\n\ntype UserWithoutId = Omit\u003CUser, \"id\">;\n\u002F\u002F { name: string; email: string; role: \"admin\" | \"member\" }",[],{"id":274,"html":275,"type":139},"b36","\u003Cp>\u003Ccode>Pick\u003C\u002Fcode> says &quot;keep only these keys&quot;; \u003Ccode>Omit\u003C\u002Fcode> says &quot;keep everything except these keys.&quot; Use \u003Ccode>Pick\u003C\u002Fcode> when the kept set is small and stable (a public-facing subset); use \u003Ccode>Omit\u003C\u002Fcode> when you&#39;re removing one or two fields from an otherwise-large shape and don&#39;t want to re-list everything you&#39;re keeping.\u003C\u002Fp>",{"id":277,"html":278,"type":139},"b37","\u003Cp>\u003Ccode>Record&lt;K, T&gt;\u003C\u002Fcode> builds an object type from a set of keys and a single value type — useful for lookup tables and maps keyed by a known union:\u003C\u002Fp>",{"id":280,"code":281,"type":186,"language":187,"highlight":282},"b38","type Role = \"admin\" | \"member\" | \"guest\";\n\nconst roleLabels: Record\u003CRole, string> = {\n  admin: \"Administrator\",\n  member: \"Member\",\n  guest: \"Guest\",\n};\n\u002F\u002F omit one key, e.g. \"guest\", and TypeScript errors: property is missing",[],{"id":284,"html":285,"type":139},"b39","\u003Cp>That last line is \u003Ccode>Record\u003C\u002Fcode>&#39;s real value over a plain index signature (\u003Ccode>{ [key: string]: string }\u003C\u002Fcode>): because the key type is a specific union, TypeScript checks that every member of the union has an entry, and rejects keys outside the union entirely.\u003C\u002Fp>",{"id":287,"html":288,"type":139},"b40","\u003C!-- playground:start -->",{"id":290,"html":291,"text":291,"type":144,"level":47},"b41","🎮 Try it yourself",{"id":293,"html":294,"type":139},"b42","\u003Cp>\u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-typescript-utility-types\u002Fplayground\">▶️ Open the interactive playground →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":296,"html":297,"type":139},"b43","\u003Cp>\u003Cem>Runs right in your browser — poke at it and watch the concept react live.\u003C\u002Fem>\u003C\u002Fp>",{"id":299,"html":300,"type":139},"b44","\u003C!-- playground:end -->",{"id":302,"html":303,"text":303,"type":144,"level":47},"b45","Stage 3: the conditional types — Exclude, Extract, NonNullable",{"id":305,"html":306,"type":139},"b46","\u003Cp>These operate on \u003Cstrong>unions\u003C\u002Fstrong>, not object shapes — think of them as set operations over the members of a union type.\u003C\u002Fp>",{"id":308,"code":309,"type":186,"language":187,"highlight":310},"b47","type Status = \"idle\" | \"loading\" | \"success\" | \"error\";\n\ntype NotIdle = Exclude\u003CStatus, \"idle\">;\n\u002F\u002F \"loading\" | \"success\" | \"error\"\n\ntype Settled = Extract\u003CStatus, \"success\" | \"error\">;\n\u002F\u002F \"success\" | \"error\"\n\ntype MaybeUser = User | null | undefined;\ntype DefiniteUser = NonNullable\u003CMaybeUser>;\n\u002F\u002F User",[],{"id":312,"html":313,"type":139},"b48","\u003Cp>\u003Ccode>Exclude&lt;T, U&gt;\u003C\u002Fcode> keeps the members of \u003Ccode>T\u003C\u002Fcode> that are \u003Cstrong>not\u003C\u002Fstrong> assignable to \u003Ccode>U\u003C\u002Fcode>; \u003Ccode>Extract&lt;T, U&gt;\u003C\u002Fcode> keeps the members that \u003Cstrong>are\u003C\u002Fstrong>. They&#39;re complements of each other over the same two inputs. \u003Ccode>NonNullable&lt;T&gt;\u003C\u002Fcode> strips \u003Ccode>null\u003C\u002Fcode> and \u003Ccode>undefined\u003C\u002Fcode> from \u003Ccode>T\u003C\u002Fcode> — it used to be defined as \u003Ccode>Exclude&lt;T, null | undefined&gt;\u003C\u002Fcode>, but since TypeScript 4.8 it&#39;s \u003Ccode>T &amp; {}\u003C\u002Fcode> instead (intersecting with the empty object type cancels \u003Ccode>null\u003C\u002Fcode> and \u003Ccode>undefined\u003C\u002Fcode> out, and unlike the old conditional type, the intersection form simplifies cleanly when \u003Ccode>T\u003C\u002Fcode> is itself generic).\u003C\u002Fp>",{"id":315,"html":316,"type":139},"b49","\u003Cp>A real use: narrowing a discriminated union after a check that a plain \u003Ccode>if\u003C\u002Fcode> can&#39;t express as a type:\u003C\u002Fp>",{"id":318,"code":319,"type":186,"language":187,"highlight":320},"b50","function isSettled(status: Status): status is Extract\u003CStatus, \"success\" | \"error\"> {\n  return status === \"success\" || status === \"error\";\n}",[],{"id":322,"html":323,"text":323,"type":144,"level":47},"b51","Stage 4: the introspection types — ReturnType, Parameters, Awaited",{"id":325,"html":326,"type":139},"b52","\u003Cp>These pull a type \u003Cstrong>out of a function signature or a Promise\u003C\u002Fstrong>, instead of transforming an object shape.\u003C\u002Fp>",{"id":328,"code":329,"type":186,"language":187,"highlight":330},"b53","function createUser(name: string, role: \"admin\" | \"member\") {\n  return { id: crypto.randomUUID(), name, role };\n}\n\ntype NewUser = ReturnType\u003Ctypeof createUser>;\n\u002F\u002F { id: string; name: string; role: \"admin\" | \"member\" }\n\ntype CreateUserArgs = Parameters\u003Ctypeof createUser>;\n\u002F\u002F [name: string, role: \"admin\" | \"member\"]\n\nasync function fetchUser(): Promise\u003CUser> {\n  \u002F* ... *\u002F\n  return {} as User;\n}\n\ntype FetchedUser = Awaited\u003CReturnType\u003Ctypeof fetchUser>>;\n\u002F\u002F User — not Promise\u003CUser>",[],{"id":332,"html":333,"type":139},"b54","\u003Cp>These three are the way to keep a type in sync with a function&#39;s \u003Cem>implementation\u003C\u002Fem> instead of a parallel hand-written declaration. \u003Ccode>typeof createUser\u003C\u002Fcode> gets you the function&#39;s type; \u003Ccode>ReturnType\u003C\u002Fcode> and \u003Ccode>Parameters\u003C\u002Fcode> pull pieces back out of it. \u003Ccode>Awaited&lt;T&gt;\u003C\u002Fcode> recursively unwraps nested promises (\u003Ccode>Promise&lt;Promise&lt;User&gt;&gt;\u003C\u002Fcode> still resolves to \u003Ccode>User\u003C\u002Fcode>), which is what makes \u003Ccode>Awaited&lt;ReturnType&lt;typeof fetchUser&gt;&gt;\u003C\u002Fcode> correct instead of leaving you with a dangling \u003Ccode>Promise&lt;User&gt;\u003C\u002Fcode>.\u003C\u002Fp>",{"id":335,"html":336,"text":336,"type":144,"level":47},"b55","Edge cases and gotchas",{"id":338,"html":339,"type":139},"b56","\u003Cp>\u003Cstrong>Every built-in here is shallow.\u003C\u002Fstrong> \u003Ccode>Partial&lt;T&gt;\u003C\u002Fcode>, \u003Ccode>Required&lt;T&gt;\u003C\u002Fcode>, and \u003Ccode>Readonly&lt;T&gt;\u003C\u002Fcode> only touch \u003Ccode>T\u003C\u002Fcode>&#39;s own top-level properties:\u003C\u002Fp>",{"id":341,"code":342,"type":186,"language":187,"highlight":343},"b57","interface Profile {\n  user: { name: string; email: string };\n}\n\ntype PartialProfile = Partial\u003CProfile>;\n\u002F\u002F { user?: { name: string; email: string } }\n\u002F\u002F user.name and user.email are still required — Partial didn't recurse\nconst p: PartialProfile = { user: { name: \"Ada\" } }; \u002F\u002F Error: email is missing",[],{"id":345,"html":346,"type":139},"b58","\u003Cp>If you need every nested field optional too, you need a recursive mapped type (often called \u003Ccode>DeepPartial\u003C\u002Fcode>) — it isn&#39;t in the standard library because &quot;how deep&quot; and &quot;should arrays recurse too&quot; are decisions a one-size-fits-all utility can&#39;t make for you.\u003C\u002Fp>",{"id":348,"html":349,"type":139},"b59","\u003Cp>\u003Cstrong>\u003Ccode>Readonly\u003C\u002Fcode> is compile-time only.\u003C\u002Fstrong> Nothing prevents \u003Ccode>Object.freeze\u003C\u002Fcode>-style mutation at runtime through an untyped reference, a cast, or library code that doesn&#39;t know about your type. \u003Ccode>Readonly&lt;T&gt;\u003C\u002Fcode> stops \u003Cem>your\u003C\u002Fem> code from writing through \u003Cem>that\u003C\u002Fem> reference; it is not a runtime guarantee.\u003C\u002Fp>",{"id":351,"html":352,"type":139},"b60","\u003Cp>\u003Cstrong>\u003Ccode>Omit\u003C\u002Fcode> on a union type silently drops fields it shouldn&#39;t.\u003C\u002Fstrong> This is the gotcha worth remembering. Recall \u003Ccode>Omit&lt;T, K&gt; = Pick&lt;T, Exclude&lt;keyof T, K&gt;&gt;\u003C\u002Fcode>. The bug is in what \u003Ccode>keyof\u003C\u002Fcode> means for a union:\u003C\u002Fp>",{"id":354,"code":355,"type":186,"language":187,"highlight":356},"b61","interface Circle { kind: \"circle\"; radius: number }\ninterface Square { kind: \"square\"; side: number }\ntype Shape = Circle | Square;\n\ntype ShapeWithoutKind = Omit\u003CShape, \"kind\">;\n\u002F\u002F You'd expect: { radius: number } | { side: number }\n\u002F\u002F You actually get: {}",[],{"id":358,"html":359,"type":139},"b62","\u003Cp>\u003Ccode>keyof (Circle | Square)\u003C\u002Fcode> is only the keys common to \u003Cem>every\u003C\u002Fem> member — here, just \u003Ccode>&quot;kind&quot;\u003C\u002Fcode> — because accessing a property on a union value only type-checks for properties every branch has. So \u003Ccode>Exclude&lt;keyof Shape, &quot;kind&quot;&gt;\u003C\u002Fcode> excludes the only common key and leaves \u003Ccode>never\u003C\u002Fcode>, and \u003Ccode>Pick&lt;Shape, never&gt;\u003C\u002Fcode> is \u003Ccode>{}\u003C\u002Fcode> for both branches. \u003Ccode>radius\u003C\u002Fcode> and \u003Ccode>side\u003C\u002Fcode> were never in the computation to begin with — they&#39;re silently gone, and \u003Ccode>ShapeWithoutKind\u003C\u002Fcode> is \u003Ccode>{}\u003C\u002Fcode>, not an error.\u003C\u002Fp>",{"id":361,"html":362,"type":139},"b63","\u003Cp>The fix is a \u003Cstrong>distributive\u003C\u002Fstrong> version that applies \u003Ccode>Omit\u003C\u002Fcode> to each union member separately before they&#39;re merged back into a union:\u003C\u002Fp>",{"id":364,"code":365,"type":186,"language":187,"highlight":366},"b64","type DistributiveOmit\u003CT, K extends PropertyKey> = T extends unknown\n  ? Omit\u003CT, K>\n  : never;\n\ntype ShapeWithoutKind = DistributiveOmit\u003CShape, \"kind\">;\n\u002F\u002F { radius: number } | { side: number } — correct",[],{"id":368,"html":369,"type":139},"b65","\u003Cp>The \u003Ccode>T extends unknown ? ... : never\u003C\u002Fcode> isn&#39;t a real check (every type extends \u003Ccode>unknown\u003C\u002Fcode>) — its only job is to make the conditional \u003Cstrong>distribute\u003C\u002Fstrong> over \u003Ccode>T\u003C\u002Fcode> when \u003Ccode>T\u003C\u002Fcode> is a union, running \u003Ccode>Omit\u003C\u002Fcode> once per branch instead of once on the merged type. This is the single most-cited TypeScript utility-type gotcha for a reason: it compiles cleanly and returns a plausible-looking empty object, so it tends to surface as a runtime bug, not a type error.\u003C\u002Fp>",{"id":371,"html":372,"text":372,"type":144,"level":47},"b66","Best practices",{"id":374,"html":375,"type":139},"b67","\u003Cp>\u003Cstrong>Reach for a built-in utility type when\u003C\u002Fstrong> you&#39;re deriving a type from one that already exists and is the source of truth — an API response shape, a Prisma\u002Fdatabase model, a component&#39;s prop type. The derived type should update automatically when the source changes; that&#39;s the entire point.\u003C\u002Fp>",{"id":377,"html":378,"type":139},"b68","\u003Cp>\u003Cstrong>Avoid them when\u003C\u002Fstrong> the &quot;derived&quot; type and the source type are only accidentally similar today and will diverge in meaning tomorrow. A \u003Ccode>LoginFormValues\u003C\u002Fcode> type that happens to share two field names with \u003Ccode>User\u003C\u002Fcode> isn&#39;t a \u003Ccode>Pick&lt;User, ...&gt;\u003C\u002Fcode> — it&#39;s its own type that should be declared as its own type.\u003C\u002Fp>",{"id":380,"html":381,"type":139},"b69","\u003Cp>\u003Cstrong>Prefer \u003Ccode>Pick\u003C\u002Fcode> over \u003Ccode>Omit\u003C\u002Fcode>\u003C\u002Fstrong> when the kept set is small (2–3 fields) and stable — it reads as an explicit allowlist and doesn&#39;t silently include a field someone adds to the source type later without you noticing. \u003Cstrong>Prefer \u003Ccode>Omit\u003C\u002Fcode>\u003C\u002Fstrong> when you&#39;re removing one or two fields from an otherwise-large, evolving shape.\u003C\u002Fp>",{"id":383,"html":384,"type":139},"b70","\u003Cp>\u003Cstrong>Reach for \u003Ccode>DistributiveOmit\u003C\u002Fcode> deliberately\u003C\u002Fstrong>, not by default — write \u003Ccode>Omit\u003C\u002Fcode> first, and only swap in the distributive version once you&#39;ve confirmed the source type is (or might become) a union. Reaching for it reflexively everywhere adds a layer of indirection most object shapes never need.\u003C\u002Fp>",{"id":386,"html":387,"text":387,"type":144,"level":47},"b71","FAQ",{"id":389,"html":390,"text":391,"type":144,"level":59},"b72","Does \u003Ccode>Partial&lt;T&gt;\u003C\u002Fcode> make nested object properties optional too?","Does Partial\u003CT> make nested object properties optional too?",{"id":393,"html":394,"type":139},"b73","\u003Cp>No. \u003Ccode>Partial\u003C\u002Fcode>, \u003Ccode>Required\u003C\u002Fcode>, and \u003Ccode>Readonly\u003C\u002Fcode> are shallow — they only transform \u003Ccode>T\u003C\u002Fcode>&#39;s own top-level properties. A property whose type is itself an object keeps that object&#39;s original required\u002Foptional fields untouched. Use a hand-written recursive mapped type if you need every nested level.\u003C\u002Fp>",{"id":396,"html":397,"text":398,"type":144,"level":59},"b74","Why does \u003Ccode>Omit\u003C\u002Fcode> return \u003Ccode>{}\u003C\u002Fcode> on a union type instead of erroring?","Why does Omit return {} on a union type instead of erroring?",{"id":400,"html":401,"type":139},"b75","\u003Cp>Because \u003Ccode>Omit&lt;T, K&gt;\u003C\u002Fcode> is implemented as \u003Ccode>Pick&lt;T, Exclude&lt;keyof T, K&gt;&gt;\u003C\u002Fcode>, and \u003Ccode>keyof\u003C\u002Fcode> on a union type only yields the keys common to every member. If the only common key is the one you&#39;re omitting, the key set to keep becomes \u003Ccode>never\u003C\u002Fcode>, and \u003Ccode>Pick&lt;T, never&gt;\u003C\u002Fcode> is \u003Ccode>{}\u003C\u002Fcode>. Use a distributive version (\u003Ccode>T extends unknown ? Omit&lt;T, K&gt; : never\u003C\u002Fcode>) to get the per-branch result you expect. See &quot;Edge cases and gotchas&quot; above for the full example.\u003C\u002Fp>",{"id":403,"html":404,"text":405,"type":144,"level":59},"b76","Can I combine utility types, like \u003Ccode>Partial&lt;Pick&lt;T, K&gt;&gt;\u003C\u002Fcode>?","Can I combine utility types, like Partial\u003CPick\u003CT, K>>?",{"id":407,"html":408,"type":139},"b77","\u003Cp>Yes — they&#39;re ordinary generic types, so they compose exactly like function calls. \u003Ccode>Partial&lt;Pick&lt;User, &quot;name&quot; | &quot;email&quot;&gt;&gt;\u003C\u002Fcode> first narrows to two fields, then makes both optional. Order matters: \u003Ccode>Pick&lt;Partial&lt;User&gt;, &quot;name&quot;&gt;\u003C\u002Fcode> makes everything optional first, then keeps only \u003Ccode>name\u003C\u002Fcode> (still optional) — a different, usually less useful, result for this case.\u003C\u002Fp>",{"id":410,"html":411,"text":412,"type":144,"level":59},"b78","What&#39;s the difference between \u003Ccode>Record&lt;string, T&gt;\u003C\u002Fcode> and an index signature?","What's the difference between Record\u003Cstring, T> and an index signature?",{"id":414,"html":415,"type":139},"b79","\u003Cp>For a plain \u003Ccode>string\u003C\u002Fcode> key type they behave almost identically — \u003Ccode>Record&lt;string, T&gt;\u003C\u002Fcode> is defined using an index signature internally. The difference matters when the key type is a specific union: \u003Ccode>Record&lt;Role, string&gt;\u003C\u002Fcode> checks that every member of \u003Ccode>Role\u003C\u002Fcode> has an entry and rejects extra keys, while \u003Ccode>{ [key: string]: string }\u003C\u002Fcode> accepts any string key and enforces nothing about which keys must be present.\u003C\u002Fp>",{"id":417,"html":418,"text":419,"type":144,"level":59},"b80","Does TypeScript have a built-in \u003Ccode>DeepPartial\u003C\u002Fcode> or \u003Ccode>DeepReadonly\u003C\u002Fcode>?","Does TypeScript have a built-in DeepPartial or DeepReadonly?",{"id":421,"html":422,"type":139},"b81","\u003Cp>No. The standard library intentionally ships only shallow versions, because &quot;how deep,&quot; &quot;should this recurse into arrays and \u003Ccode>Map\u003C\u002Fcode>\u002F\u003Ccode>Set\u003C\u002Fcode>,&quot; and &quot;should functions be left alone&quot; are decisions that vary by use case. Write your own recursive mapped type, or use a small, well-tested library version if you need one across a codebase.\u003C\u002Fp>",{"id":424,"html":425,"text":425,"type":144,"level":47},"b82","Cheat sheet",{"id":427,"head":428,"rows":432,"type":484},"b83",[429,430,431],"Task","Code","Notes",[433,437,441,445,449,453,457,461,465,469,473,477,480],[434,435,436],"Make every property optional","\u003Ccode>Partial&lt;T&gt;\u003C\u002Fcode>","Shallow — nested objects keep their original required fields",[438,439,440],"Make every property required","\u003Ccode>Required&lt;T&gt;\u003C\u002Fcode>","Removes the \u003Ccode>?\u003C\u002Fcode> modifier everywhere, shallow",[442,443,444],"Make every property readonly","\u003Ccode>Readonly&lt;T&gt;\u003C\u002Fcode>","Compile-time only, shallow, no runtime freeze",[446,447,448],"Keep only some properties","\u003Ccode>Pick&lt;T, &quot;a&quot; | &quot;b&quot;&gt;\u003C\u002Fcode>","Explicit allowlist; new fields on \u003Ccode>T\u003C\u002Fcode> are excluded by default",[450,451,452],"Remove some properties","\u003Ccode>Omit&lt;T, &quot;a&quot; | &quot;b&quot;&gt;\u003C\u002Fcode>","Based on \u003Ccode>Pick\u003C\u002Fcode> + \u003Ccode>Exclude\u003C\u002Fcode> — see the union gotcha before using on a union",[454,455,456],"Omit on a union, correctly","\u003Ccode>T extends unknown ? Omit&lt;T, K&gt; : never\u003C\u002Fcode>","Forces per-branch distribution",[458,459,460],"Build a lookup object type","\u003Ccode>Record&lt;K, T&gt;\u003C\u002Fcode>","\u003Ccode>K\u003C\u002Fcode> a union enforces every key is present and no extra keys",[462,463,464],"Keep union members assignable to \u003Ccode>U\u003C\u002Fcode>","\u003Ccode>Extract&lt;T, U&gt;\u003C\u002Fcode>","",[466,467,468],"Remove union members assignable to \u003Ccode>U\u003C\u002Fcode>","\u003Ccode>Exclude&lt;T, U&gt;\u003C\u002Fcode>","Complement of \u003Ccode>Extract\u003C\u002Fcode>",[470,471,472],"Strip \u003Ccode>null\u003C\u002Fcode>\u002F\u003Ccode>undefined\u003C\u002Fcode> from a type","\u003Ccode>NonNullable&lt;T&gt;\u003C\u002Fcode>","\u003Ccode>T &amp; {}\u003C\u002Fcode> since TS 4.8 (was \u003Ccode>Exclude&lt;T, null | undefined&gt;\u003C\u002Fcode> before that)",[474,475,476],"Get a function&#39;s return type","\u003Ccode>ReturnType&lt;typeof fn&gt;\u003C\u002Fcode>","Use \u003Ccode>typeof fn\u003C\u002Fcode>, not \u003Ccode>fn\u003C\u002Fcode>, to reference the function&#39;s type",[478,479,464],"Get a function&#39;s parameter tuple","\u003Ccode>Parameters&lt;typeof fn&gt;\u003C\u002Fcode>",[481,482,483],"Unwrap a (possibly nested) Promise","\u003Ccode>Awaited&lt;T&gt;\u003C\u002Fcode>","\u003Ccode>Awaited&lt;ReturnType&lt;typeof asyncFn&gt;&gt;\u003C\u002Fcode> gives the resolved value&#39;s type","table",{"id":486,"code":487,"type":186,"language":187,"highlight":488},"b84","\u002F\u002F the whole pattern, copy-paste ready\ninterface User {\n  id: string;\n  name: string;\n  email: string;\n  role: \"admin\" | \"member\";\n}\n\n\u002F\u002F derive, don't retype\ntype PublicUser = Pick\u003CUser, \"id\" | \"name\">;\ntype UpdateUserInput = Partial\u003COmit\u003CUser, \"id\">>;\ntype UserMap = Record\u003Cstring, User>;\n\ntype DistributiveOmit\u003CT, K extends PropertyKey> = T extends unknown\n  ? Omit\u003CT, K>\n  : never;",[],{"id":490,"html":491,"type":139},"b85","\u003C!-- quiz:start -->",{"id":493,"html":494,"text":494,"type":144,"level":47},"b86","🧠 Test yourself",{"id":496,"html":497,"type":139},"b87","\u003Cp>Think it clicked? \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-typescript-utility-types\u002Fquiz\">Take the 8-question quiz →\u003C\u002Fa>\u003C\u002Fstrong>\u003C\u002Fp>",{"id":499,"html":500,"type":139},"b88","\u003Cp>\u003Cem>Instant feedback, a hint on every question, and an explanation for each answer — right or wrong.\u003C\u002Fem>\u003C\u002Fp>",{"id":502,"html":503,"type":139},"b89","\u003C!-- quiz:end -->",{"id":505,"html":506,"text":506,"type":144,"level":47},"b90","Key takeaways",{"id":508,"type":150,"items":509,"ordered":12},"b91",[510,511,512,513],"A utility type is a mapped type (\u003Ccode>[K in keyof T]\u003C\u002Fcode>) or a conditional type (\u003Ccode>T extends U ? X : Y\u003C\u002Fcode>) someone already wrote — not a special compiler feature. You can write your own.","\u003Ccode>Partial\u003C\u002Fcode>, \u003Ccode>Required\u003C\u002Fcode>, and \u003Ccode>Readonly\u003C\u002Fcode> change modifiers; \u003Ccode>Pick\u003C\u002Fcode>, \u003Ccode>Omit\u003C\u002Fcode>, and \u003Ccode>Record\u003C\u002Fcode> change which keys exist; \u003Ccode>Exclude\u003C\u002Fcode>\u002F\u003Ccode>Extract\u003C\u002Fcode>\u002F\u003Ccode>NonNullable\u003C\u002Fcode> operate on unions; \u003Ccode>ReturnType\u003C\u002Fcode>\u002F\u003Ccode>Parameters\u003C\u002Fcode>\u002F\u003Ccode>Awaited\u003C\u002Fcode> pull types out of function signatures.","Every built-in here is shallow — nested objects are untouched unless you write a recursive version yourself.","\u003Ccode>Omit\u003C\u002Fcode> on a union type can silently collapse to \u003Ccode>{}\u003C\u002Fcode>. If the source type might be a union, use a distributive \u003Ccode>Omit\u003C\u002Fcode>.",{"id":515,"html":516,"type":139},"b92","\u003Cp>That \u003Ccode>UpdateUserInput\u003C\u002Fcode> from the opening — the one that quietly missed a field — was never going to catch up to \u003Ccode>User\u003C\u002Fcode> by being retyped more carefully. It needed to stop being its own type and become a computation over \u003Ccode>User\u003C\u002Fcode> instead. That&#39;s what every utility type in this guide is: not a list of twenty names to memorize, but two small tools — loop over keys, branch on assignability — applied again and again.\u003C\u002Fp>",{"id":518,"html":519,"type":139},"b93","\u003Cp>Which one bit you first: the shallow \u003Ccode>Partial\u003C\u002Fcode>, or the union \u003Ccode>Omit\u003C\u002Fcode>? Tell me in the comments — I&#39;ll compile the most common one into next week&#39;s &quot;gotchas&quot; post.\u003C\u002Fp>",{"id":521,"html":522,"type":139},"b94","\u003C!-- related:start -->",{"id":524,"html":525,"text":525,"type":144,"level":47},"b95","📚 Read next",{"id":527,"type":150,"items":528,"ordered":12},"b96",[529,530,531],"\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-typescript-generics\">TypeScript Generics: The Complete Guide (with Cheat Sheet)\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-web-workers\">Web Workers in JavaScript: The Complete Guide\u003C\u002Fa>","\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-javascript-proxy-reflect\">JavaScript Proxy and Reflect: The Complete Guide\u003C\u002Fa>",{"id":533,"html":534,"type":139},"b97","\u003C!-- related:end -->",{"id":536,"type":537},"b98","divider",{"id":539,"html":540,"type":139},"b99","\u003Cp>🚀 \u003Cstrong>Want more like this?\u003C\u002Fstrong> Every guide, playground, and quiz lives on \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">bestpractic.org\u003C\u002Fa>\u003C\u002Fstrong> — open it and \u003Cstrong>\u003Ca href=\"https:\u002F\u002Fbestpractic.org\u002F\">sign up free\u003C\u002Fa>\u003C\u002Fstrong> so the next one finds you.\u003C\u002Fp>",{"id":542,"html":543,"type":139},"b100","\u003Cp>\u003Cem>Thanks for reading! Let&#39;s stay connected:\u003C\u002Fem>\u003C\u002Fp>",{"id":545,"type":150,"items":546,"ordered":12},"b101",[547,548,549],"⭐ \u003Cstrong>GitHub\u003C\u002Fstrong> — follow me and star the projects: \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fparsajiravand\">github.com\u002Fparsajiravand\u003C\u002Fa>","💬 \u003Cstrong>Discord\u003C\u002Fstrong> — join the frontend best-practices community: \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ\">discord.gg\u002Fd9KRhuAwQ\u003C\u002Fa>","📸 \u003Cstrong>Instagram\u003C\u002Fstrong> — frontend best practices, daily: \u003Ca href=\"https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F\">@bestpractice___\u003C\u002Fa>","You add a field to your `User` interface. Somewhere three files away, a hand-written `UpdateUserInput` type — built the week before by copying `User` and manually marking six fields optional — doesn't get the memo. It still compiles. It's just wrong, and nothing tells you until a form silently drops the new field at runtime.\n\n## What you'll learn\n\nBy the end of this guide you'll be able to:\n\n- Explain what a utility type actually is under the hood — not a special compiler feature, just a mapped or conditional type someone wrote once\n- Use `Partial`, `Required`, `Readonly`, `Pick`, `Omit`, and `Record` correctly, including the shallow-ness that trips people up\n- Use `Exclude`, `Extract`, `NonNullable`, `ReturnType`, `Parameters`, and `Awaited` to derive types from other types instead of hand-writing them\n- Recognize why `Omit` silently drops fields on a union type, and fix it with a two-line distributive version\n- Decide when reaching for a built-in utility type is the right call, and when a hand-written type is clearer\n\n**Who this is for:** you've written interfaces, functions, and generics in TypeScript, and you've used `Partial\u003CT>` or `Omit\u003CT, K>` without being totally sure what they expand to.\n\n## Contents\n\n- [Why utility types exist](#why-utility-types-exist)\n- [The mental model](#the-mental-model-utility-types-are-just-mapped-and-conditional-types)\n- [Stage 1: the modifier types — Partial, Required, Readonly](#stage-1-the-modifier-types-partial-required-readonly)\n- [Stage 2: the key-selection types — Pick, Omit, Record](#stage-2-the-key-selection-types-pick-omit-record)\n- [Stage 3: the conditional types — Exclude, Extract, NonNullable](#stage-3-the-conditional-types-exclude-extract-nonnullable)\n- [Stage 4: the introspection types — ReturnType, Parameters, Awaited](#stage-4-the-introspection-types-returntype-parameters-awaited)\n- [Edge cases and gotchas](#edge-cases-and-gotchas)\n- [Best practices](#best-practices)\n- [FAQ](#faq)\n- [Cheat sheet](#cheat-sheet)\n- [Key takeaways](#key-takeaways)\n\n## Why utility types exist\n\nHere's the naïve version of the opening story, written out:\n\n```ts\ninterface User {\n  id: string;\n  name: string;\n  email: string;\n  role: \"admin\" | \"member\";\n}\n\n\u002F\u002F hand-written, copy-pasted from User the week before this field existed\ninterface UpdateUserInput {\n  name?: string;\n  email?: string;\n  role?: \"admin\" | \"member\";\n  \u002F\u002F id intentionally left off — you don't update the id\n  \u002F\u002F ...and whatever gets added to User next just won't show up here\n}\n```\n\n`UpdateUserInput` isn't connected to `User` in any way the compiler can see. It's a second, independent type that happens to look similar today. Add `avatarUrl` to `User` and `UpdateUserInput` has no idea — it keeps compiling, keeps passing review, and keeps being wrong.\n\nThe fix is to **derive** the new type from the old one instead of retyping it:\n\n```ts\ntype UpdateUserInput = Partial\u003COmit\u003CUser, \"id\">>;\n\u002F\u002F { name?: string; email?: string; role?: (\"admin\" | \"member\") | undefined }\n```\n\nNow `UpdateUserInput` is a *computation* over `User`, not a copy of it. Add `avatarUrl` to `User` and `UpdateUserInput` picks it up automatically, still optional, still without `id`. `Partial` and `Omit` are the two utility types doing that work — and they ship with TypeScript's standard library, in `lib.es5.d.ts`, as plain type aliases you could have written yourself.\n\n## The mental model: utility types are just mapped and conditional types\n\n**The mental model:** a utility type is not a compiler feature — it's an ordinary generic type alias, built from two tools you already have: a **mapped type** (loop over a type's keys and transform each property) and a **conditional type** (branch on whether one type is assignable to another). TypeScript ships about twenty of these pre-written so you don't retype them, but nothing stops you from writing your own.\n\nHere's `Partial\u003CT>` in full — this is close to its real definition in `lib.es5.d.ts`:\n\n```ts\ntype MyPartial\u003CT> = {\n  [K in keyof T]?: T[K];\n};\n```\n\nRead it like a `for...in` loop over types: `K in keyof T` walks every key of `T`; `?:` adds the optional modifier to each one; `T[K]` keeps that property's original type. That's the entire mechanism. `Required\u003CT>` is the same loop with `-?` (remove the optional modifier) instead of `?`. `Readonly\u003CT>` is the same loop with `readonly` added. Three \"different\" utility types, one template, one character changed each time.\n\n`Pick` and `Omit` use the same mapped-type loop, but over a narrower or computed set of keys instead of all of `keyof T`:\n\n```ts\ntype MyPick\u003CT, K extends keyof T> = {\n  [P in K]: T[P];\n};\n\ntype MyOmit\u003CT, K extends keyof any> = MyPick\u003CT, Exclude\u003Ckeyof T, K>>;\n```\n\n`Omit` isn't its own primitive — it's `Pick` over \"every key except these,\" and \"every key except these\" is `Exclude`, a **conditional type**:\n\n```ts\ntype MyExclude\u003CT, U> = T extends U ? never : T;\n```\n\nRead that as: for each member of `T`, if it's assignable to `U`, replace it with `never` (which then vanishes from a union); otherwise keep it. This single four-word conditional is the engine behind `Exclude`, `Extract`, and — as you'll see in the edge cases section — the reason `Omit` behaves unexpectedly on union types.\n\n> **Key concept:** once you can read `[K in keyof T]` as \"loop over keys\" and `T extends U ? X : Y` as \"branch on assignability,\" every utility type in the standard library is legible on sight. You're not memorizing twenty names — you're applying two patterns.\n\n## Stage 1: the modifier types — Partial, Required, Readonly\n\nThese three change *which modifiers* apply to every property, without touching which properties exist.\n\n```ts\ninterface Config {\n  host: string;\n  port: number;\n  debug?: boolean;\n}\n\ntype PartialConfig = Partial\u003CConfig>;\n\u002F\u002F { host?: string; port?: number; debug?: boolean }\n\ntype RequiredConfig = Required\u003CConfig>;\n\u002F\u002F { host: string; port: number; debug: boolean }  — debug's \"?\" is gone\n\ntype ReadonlyConfig = Readonly\u003CConfig>;\n\u002F\u002F { readonly host: string; readonly port: number; readonly debug?: boolean }\n```\n\n`Partial` is the one you reach for constantly: update payloads, form state before every field is filled in, default-merging (`{ ...defaults, ...overrides }` where `overrides: Partial\u003CConfig>`). `Required` is its mirror — useful for asserting that, after validation, every optional field has in fact been filled:\n\n```ts\nfunction startServer(config: Required\u003CConfig>) {\n  \u002F\u002F debug is guaranteed defined here — the compiler enforces it at the call site\n}\n```\n\n`Readonly` prevents reassignment of top-level properties:\n\n```ts\nconst c: Readonly\u003CConfig> = { host: \"localhost\", port: 3000 };\nc.port = 4000; \u002F\u002F Error: Cannot assign to 'port' because it is a read-only property.\n```\n\n## Stage 2: the key-selection types — Pick, Omit, Record\n\nThese change *which properties exist*, keeping their original modifiers and types.\n\n```ts\ninterface User {\n  id: string;\n  name: string;\n  email: string;\n  role: \"admin\" | \"member\";\n}\n\ntype PublicUser = Pick\u003CUser, \"id\" | \"name\">;\n\u002F\u002F { id: string; name: string }\n\ntype UserWithoutId = Omit\u003CUser, \"id\">;\n\u002F\u002F { name: string; email: string; role: \"admin\" | \"member\" }\n```\n\n`Pick` says \"keep only these keys\"; `Omit` says \"keep everything except these keys.\" Use `Pick` when the kept set is small and stable (a public-facing subset); use `Omit` when you're removing one or two fields from an otherwise-large shape and don't want to re-list everything you're keeping.\n\n`Record\u003CK, T>` builds an object type from a set of keys and a single value type — useful for lookup tables and maps keyed by a known union:\n\n```ts\ntype Role = \"admin\" | \"member\" | \"guest\";\n\nconst roleLabels: Record\u003CRole, string> = {\n  admin: \"Administrator\",\n  member: \"Member\",\n  guest: \"Guest\",\n};\n\u002F\u002F omit one key, e.g. \"guest\", and TypeScript errors: property is missing\n```\n\nThat last line is `Record`'s real value over a plain index signature (`{ [key: string]: string }`): because the key type is a specific union, TypeScript checks that every member of the union has an entry, and rejects keys outside the union entirely.\n\n\u003C!-- playground:start -->\n\n## 🎮 Try it yourself\n\n**[▶️ Open the interactive playground →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-typescript-utility-types\u002Fplayground)**\n\n_Runs right in your browser — poke at it and watch the concept react live._\n\n\u003C!-- playground:end -->\n\n## Stage 3: the conditional types — Exclude, Extract, NonNullable\n\nThese operate on **unions**, not object shapes — think of them as set operations over the members of a union type.\n\n```ts\ntype Status = \"idle\" | \"loading\" | \"success\" | \"error\";\n\ntype NotIdle = Exclude\u003CStatus, \"idle\">;\n\u002F\u002F \"loading\" | \"success\" | \"error\"\n\ntype Settled = Extract\u003CStatus, \"success\" | \"error\">;\n\u002F\u002F \"success\" | \"error\"\n\ntype MaybeUser = User | null | undefined;\ntype DefiniteUser = NonNullable\u003CMaybeUser>;\n\u002F\u002F User\n```\n\n`Exclude\u003CT, U>` keeps the members of `T` that are **not** assignable to `U`; `Extract\u003CT, U>` keeps the members that **are**. They're complements of each other over the same two inputs. `NonNullable\u003CT>` strips `null` and `undefined` from `T` — it used to be defined as `Exclude\u003CT, null | undefined>`, but since TypeScript 4.8 it's `T & {}` instead (intersecting with the empty object type cancels `null` and `undefined` out, and unlike the old conditional type, the intersection form simplifies cleanly when `T` is itself generic).\n\nA real use: narrowing a discriminated union after a check that a plain `if` can't express as a type:\n\n```ts\nfunction isSettled(status: Status): status is Extract\u003CStatus, \"success\" | \"error\"> {\n  return status === \"success\" || status === \"error\";\n}\n```\n\n## Stage 4: the introspection types — ReturnType, Parameters, Awaited\n\nThese pull a type **out of a function signature or a Promise**, instead of transforming an object shape.\n\n```ts\nfunction createUser(name: string, role: \"admin\" | \"member\") {\n  return { id: crypto.randomUUID(), name, role };\n}\n\ntype NewUser = ReturnType\u003Ctypeof createUser>;\n\u002F\u002F { id: string; name: string; role: \"admin\" | \"member\" }\n\ntype CreateUserArgs = Parameters\u003Ctypeof createUser>;\n\u002F\u002F [name: string, role: \"admin\" | \"member\"]\n\nasync function fetchUser(): Promise\u003CUser> {\n  \u002F* ... *\u002F\n  return {} as User;\n}\n\ntype FetchedUser = Awaited\u003CReturnType\u003Ctypeof fetchUser>>;\n\u002F\u002F User — not Promise\u003CUser>\n```\n\nThese three are the way to keep a type in sync with a function's *implementation* instead of a parallel hand-written declaration. `typeof createUser` gets you the function's type; `ReturnType` and `Parameters` pull pieces back out of it. `Awaited\u003CT>` recursively unwraps nested promises (`Promise\u003CPromise\u003CUser>>` still resolves to `User`), which is what makes `Awaited\u003CReturnType\u003Ctypeof fetchUser>>` correct instead of leaving you with a dangling `Promise\u003CUser>`.\n\n## Edge cases and gotchas\n\n**Every built-in here is shallow.** `Partial\u003CT>`, `Required\u003CT>`, and `Readonly\u003CT>` only touch `T`'s own top-level properties:\n\n```ts\ninterface Profile {\n  user: { name: string; email: string };\n}\n\ntype PartialProfile = Partial\u003CProfile>;\n\u002F\u002F { user?: { name: string; email: string } }\n\u002F\u002F user.name and user.email are still required — Partial didn't recurse\nconst p: PartialProfile = { user: { name: \"Ada\" } }; \u002F\u002F Error: email is missing\n```\n\nIf you need every nested field optional too, you need a recursive mapped type (often called `DeepPartial`) — it isn't in the standard library because \"how deep\" and \"should arrays recurse too\" are decisions a one-size-fits-all utility can't make for you.\n\n**`Readonly` is compile-time only.** Nothing prevents `Object.freeze`-style mutation at runtime through an untyped reference, a cast, or library code that doesn't know about your type. `Readonly\u003CT>` stops *your* code from writing through *that* reference; it is not a runtime guarantee.\n\n**`Omit` on a union type silently drops fields it shouldn't.** This is the gotcha worth remembering. Recall `Omit\u003CT, K> = Pick\u003CT, Exclude\u003Ckeyof T, K>>`. The bug is in what `keyof` means for a union:\n\n```ts\ninterface Circle { kind: \"circle\"; radius: number }\ninterface Square { kind: \"square\"; side: number }\ntype Shape = Circle | Square;\n\ntype ShapeWithoutKind = Omit\u003CShape, \"kind\">;\n\u002F\u002F You'd expect: { radius: number } | { side: number }\n\u002F\u002F You actually get: {}\n```\n\n`keyof (Circle | Square)` is only the keys common to *every* member — here, just `\"kind\"` — because accessing a property on a union value only type-checks for properties every branch has. So `Exclude\u003Ckeyof Shape, \"kind\">` excludes the only common key and leaves `never`, and `Pick\u003CShape, never>` is `{}` for both branches. `radius` and `side` were never in the computation to begin with — they're silently gone, and `ShapeWithoutKind` is `{}`, not an error.\n\nThe fix is a **distributive** version that applies `Omit` to each union member separately before they're merged back into a union:\n\n```ts\ntype DistributiveOmit\u003CT, K extends PropertyKey> = T extends unknown\n  ? Omit\u003CT, K>\n  : never;\n\ntype ShapeWithoutKind = DistributiveOmit\u003CShape, \"kind\">;\n\u002F\u002F { radius: number } | { side: number } — correct\n```\n\nThe `T extends unknown ? ... : never` isn't a real check (every type extends `unknown`) — its only job is to make the conditional **distribute** over `T` when `T` is a union, running `Omit` once per branch instead of once on the merged type. This is the single most-cited TypeScript utility-type gotcha for a reason: it compiles cleanly and returns a plausible-looking empty object, so it tends to surface as a runtime bug, not a type error.\n\n## Best practices\n\n**Reach for a built-in utility type when** you're deriving a type from one that already exists and is the source of truth — an API response shape, a Prisma\u002Fdatabase model, a component's prop type. The derived type should update automatically when the source changes; that's the entire point.\n\n**Avoid them when** the \"derived\" type and the source type are only accidentally similar today and will diverge in meaning tomorrow. A `LoginFormValues` type that happens to share two field names with `User` isn't a `Pick\u003CUser, ...>` — it's its own type that should be declared as its own type.\n\n**Prefer `Pick` over `Omit`** when the kept set is small (2–3 fields) and stable — it reads as an explicit allowlist and doesn't silently include a field someone adds to the source type later without you noticing. **Prefer `Omit`** when you're removing one or two fields from an otherwise-large, evolving shape.\n\n**Reach for `DistributiveOmit` deliberately**, not by default — write `Omit` first, and only swap in the distributive version once you've confirmed the source type is (or might become) a union. Reaching for it reflexively everywhere adds a layer of indirection most object shapes never need.\n\n## FAQ\n\n### Does `Partial\u003CT>` make nested object properties optional too?\n\nNo. `Partial`, `Required`, and `Readonly` are shallow — they only transform `T`'s own top-level properties. A property whose type is itself an object keeps that object's original required\u002Foptional fields untouched. Use a hand-written recursive mapped type if you need every nested level.\n\n### Why does `Omit` return `{}` on a union type instead of erroring?\n\nBecause `Omit\u003CT, K>` is implemented as `Pick\u003CT, Exclude\u003Ckeyof T, K>>`, and `keyof` on a union type only yields the keys common to every member. If the only common key is the one you're omitting, the key set to keep becomes `never`, and `Pick\u003CT, never>` is `{}`. Use a distributive version (`T extends unknown ? Omit\u003CT, K> : never`) to get the per-branch result you expect. See \"Edge cases and gotchas\" above for the full example.\n\n### Can I combine utility types, like `Partial\u003CPick\u003CT, K>>`?\n\nYes — they're ordinary generic types, so they compose exactly like function calls. `Partial\u003CPick\u003CUser, \"name\" | \"email\">>` first narrows to two fields, then makes both optional. Order matters: `Pick\u003CPartial\u003CUser>, \"name\">` makes everything optional first, then keeps only `name` (still optional) — a different, usually less useful, result for this case.\n\n### What's the difference between `Record\u003Cstring, T>` and an index signature?\n\nFor a plain `string` key type they behave almost identically — `Record\u003Cstring, T>` is defined using an index signature internally. The difference matters when the key type is a specific union: `Record\u003CRole, string>` checks that every member of `Role` has an entry and rejects extra keys, while `{ [key: string]: string }` accepts any string key and enforces nothing about which keys must be present.\n\n### Does TypeScript have a built-in `DeepPartial` or `DeepReadonly`?\n\nNo. The standard library intentionally ships only shallow versions, because \"how deep,\" \"should this recurse into arrays and `Map`\u002F`Set`,\" and \"should functions be left alone\" are decisions that vary by use case. Write your own recursive mapped type, or use a small, well-tested library version if you need one across a codebase.\n\n## Cheat sheet\n\n| Task | Code | Notes |\n| --- | --- | --- |\n| Make every property optional | `Partial\u003CT>` | Shallow — nested objects keep their original required fields |\n| Make every property required | `Required\u003CT>` | Removes the `?` modifier everywhere, shallow |\n| Make every property readonly | `Readonly\u003CT>` | Compile-time only, shallow, no runtime freeze |\n| Keep only some properties | `Pick\u003CT, \"a\" \\| \"b\">` | Explicit allowlist; new fields on `T` are excluded by default |\n| Remove some properties | `Omit\u003CT, \"a\" \\| \"b\">` | Based on `Pick` + `Exclude` — see the union gotcha before using on a union |\n| Omit on a union, correctly | `T extends unknown ? Omit\u003CT, K> : never` | Forces per-branch distribution |\n| Build a lookup object type | `Record\u003CK, T>` | `K` a union enforces every key is present and no extra keys |\n| Keep union members assignable to `U` | `Extract\u003CT, U>` | |\n| Remove union members assignable to `U` | `Exclude\u003CT, U>` | Complement of `Extract` |\n| Strip `null`\u002F`undefined` from a type | `NonNullable\u003CT>` | `T & {}` since TS 4.8 (was `Exclude\u003CT, null \\| undefined>` before that) |\n| Get a function's return type | `ReturnType\u003Ctypeof fn>` | Use `typeof fn`, not `fn`, to reference the function's type |\n| Get a function's parameter tuple | `Parameters\u003Ctypeof fn>` | |\n| Unwrap a (possibly nested) Promise | `Awaited\u003CT>` | `Awaited\u003CReturnType\u003Ctypeof asyncFn>>` gives the resolved value's type |\n\n```ts\n\u002F\u002F the whole pattern, copy-paste ready\ninterface User {\n  id: string;\n  name: string;\n  email: string;\n  role: \"admin\" | \"member\";\n}\n\n\u002F\u002F derive, don't retype\ntype PublicUser = Pick\u003CUser, \"id\" | \"name\">;\ntype UpdateUserInput = Partial\u003COmit\u003CUser, \"id\">>;\ntype UserMap = Record\u003Cstring, User>;\n\ntype DistributiveOmit\u003CT, K extends PropertyKey> = T extends unknown\n  ? Omit\u003CT, K>\n  : never;\n```\n\n\n\u003C!-- quiz:start -->\n\n## 🧠 Test yourself\n\nThink it clicked? **[Take the 8-question quiz →](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-typescript-utility-types\u002Fquiz)**\n\n_Instant feedback, a hint on every question, and an explanation for each answer — right or wrong._\n\n\u003C!-- quiz:end -->\n## Key takeaways\n\n- A utility type is a mapped type (`[K in keyof T]`) or a conditional type (`T extends U ? X : Y`) someone already wrote — not a special compiler feature. You can write your own.\n- `Partial`, `Required`, and `Readonly` change modifiers; `Pick`, `Omit`, and `Record` change which keys exist; `Exclude`\u002F`Extract`\u002F`NonNullable` operate on unions; `ReturnType`\u002F`Parameters`\u002F`Awaited` pull types out of function signatures.\n- Every built-in here is shallow — nested objects are untouched unless you write a recursive version yourself.\n- `Omit` on a union type can silently collapse to `{}`. If the source type might be a union, use a distributive `Omit`.\n\nThat `UpdateUserInput` from the opening — the one that quietly missed a field — was never going to catch up to `User` by being retyped more carefully. It needed to stop being its own type and become a computation over `User` instead. That's what every utility type in this guide is: not a list of twenty names to memorize, but two small tools — loop over keys, branch on assignability — applied again and again.\n\nWhich one bit you first: the shallow `Partial`, or the union `Omit`? Tell me in the comments — I'll compile the most common one into next week's \"gotchas\" post.\n\n\u003C!-- related:start -->\n\n## 📚 Read next\n\n- [TypeScript Generics: The Complete Guide (with Cheat Sheet)](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-typescript-generics)\n- [Web Workers in JavaScript: The Complete Guide](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-web-workers)\n- [JavaScript Proxy and Reflect: The Complete Guide](https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-javascript-proxy-reflect)\n\n\u003C!-- related:end -->\n\n---\n\n🚀 **Want more like this?** Every guide, playground, and quiz lives on **[bestpractic.org](https:\u002F\u002Fbestpractic.org\u002F)** — open it and **[sign up free](https:\u002F\u002Fbestpractic.org\u002F)** so the next one finds you.\n\n*Thanks for reading! Let's stay connected:*\n\n- ⭐ **GitHub** — follow me and star the projects: [github.com\u002Fparsajiravand](https:\u002F\u002Fgithub.com\u002Fparsajiravand)\n- 💬 **Discord** — join the frontend best-practices community: [discord.gg\u002Fd9KRhuAwQ](https:\u002F\u002Fdiscord.gg\u002Fd9KRhuAwQ)\n- 📸 **Instagram** — frontend best practices, daily: [@bestpractice___](https:\u002F\u002Fwww.instagram.com\u002Fbestpractice___\u002F)",{"title":111,"canonical":552,"description":112},"https:\u002F\u002Fbestpractic.org\u002Fblog\u002Fweekly-typescript-utility-types","01a1df1b-1e04-73b8-9561-5c49b04a8e5f",{"name":555,"part":10,"total":556,"items":557},"Deep Dive",9,[558,562,566,570,574,579,583,587,588],{"slug":559,"title":560,"publishedAt":561,"readingMinutes":108},"weekly-javascript-event-loop","JavaScript Event Loop Explained: The Complete Guide","2026-07-13T09:36:33.464Z",{"slug":563,"title":564,"publishedAt":565,"readingMinutes":114},"weekly-typescript-generics","TypeScript Generics: The Complete Guide (with Cheat Sheet)","2026-07-20T09:23:23.621Z",{"slug":567,"title":568,"publishedAt":569,"readingMinutes":114},"weekly-cors-explained","CORS Explained: The Complete Guide (with Cheat Sheet)","2026-08-03T09:54:26.268Z",{"slug":571,"title":572,"publishedAt":573,"readingMinutes":114},"weekly-javascript-proxy-reflect","JavaScript Proxy and Reflect: The Complete Guide","2026-08-24T07:06:37.948Z",{"slug":575,"title":576,"publishedAt":577,"readingMinutes":578},"weekly-javascript-closures","JavaScript Closures: The Complete Guide (with Cheat Sheet)","2026-08-25T08:53:48.904Z",14,{"slug":580,"title":581,"publishedAt":582,"readingMinutes":578},"weekly-debounce-and-throttle","Debounce and Throttle in JavaScript: The Complete Guide","2026-08-31T13:12:14.139Z",{"slug":584,"title":585,"publishedAt":586,"readingMinutes":108},"weekly-web-workers","Web Workers in JavaScript: The Complete Guide","2026-09-07T12:03:05.323Z",{"slug":5,"title":111,"publishedAt":115,"readingMinutes":114},{"slug":589,"title":590,"publishedAt":591,"readingMinutes":114},"weekly-typescript-type-narrowing","TypeScript Type Narrowing: The Complete Guide","2026-11-27T11:46:59.418Z",{"id":593,"locked":12},"01a1df1b-1e30-7643-b6fc-c3a7097fc7e5",[595],{"id":4,"slug":5,"title":7,"_count":596},{"questions":10},[598],{"locale":32,"slug":5},{"id":4,"slug":5,"title":7,"_count":600,"questionCount":10},{"questions":10},[]]