[{"data":1,"prerenderedAt":449},["ShallowReactive",2],{"navigation_docs":3,"diagnostic-content-TS0013":48},[4,8,12,16,20,24,28,32,36,40,44],{"title":5,"path":6,"stem":7},"CLI","\u002Fcli","1.cli",{"title":9,"path":10,"stem":11},"Nuxt","\u002Fnuxt","2.nuxt",{"title":13,"path":14,"stem":15},"Vue","\u002Fvue","3.vue",{"title":17,"path":18,"stem":19},"Vite","\u002Fvite","4.vite",{"title":21,"path":22,"stem":23},"Nitro","\u002Fnitro","5.nitro",{"title":25,"path":26,"stem":27},"TypeScript","\u002Ftypescript","6.typescript",{"title":29,"path":30,"stem":31},"shadcn","\u002Fshadcn","7.shadcn",{"title":33,"path":34,"stem":35},"Package","\u002Fpackage","8.package",{"title":37,"path":38,"stem":39},"Extending Doctor","\u002Fextending","9.extending",{"title":41,"path":42,"stem":43},"MCP","\u002Fmcp","9.mcp",{"title":45,"path":46,"stem":47},"Pinia","\u002Fpinia","9.pinia",{"id":49,"title":50,"body":51,"category":57,"code":439,"description":440,"docsUrl":58,"extension":441,"fix":90,"framework":442,"meta":443,"navigation":292,"pack":60,"path":444,"ruleId":61,"rulePath":62,"seo":445,"severity":63,"source":64,"sourceUrl":65,"stem":446,"why":447,"__hash__":448},"diagnostics\u002Fdiagnostics\u002FTS0013.md","TS0013: Do not use instanceof for web platform values from another realm",{"type":52,"value":53,"toc":429},"minimark",[54,66,71,84,88,91,95,100,103,207,210,360,364,367,397,401,413,417,425],[55,56],"rule-metadata",{"category":57,"docsUrl":58,"fix":59,"pack":60,"ruleId":61,"rulePath":62,"severity":63,"source":64,"sourceUrl":65},"boundaries","https:\u002F\u002Fdeveloper.mozilla.org\u002Fen-US\u002Fdocs\u002FWeb\u002FJavaScript\u002FReference\u002FOperators\u002Finstanceof#instanceof_and_multiple_realms","structural-review","vite-doctor\u002Ftypescript","typescript\u002Fboundaries\u002Fno-cross-realm-web-instanceof","\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-web-instanceof","warn","src\u002Frule-packs\u002Ftypescript\u002Frules\u002Fno-cross-realm-web-instanceof.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Ftypescript\u002Frules\u002Fno-cross-realm-web-instanceof.ts",[67,68,70],"h2",{"id":69},"why-it-happens","Why it happens",[72,73,74,75,79,80,83],"p",{},"Response, Request, Headers, Blob, URL, ArrayBuffer, Uint8Array and the other web platform classes have one constructor per realm, and often more than one per process: a second copy of undici such as Miniflare's, the Blob and URL of a Vitest DOM environment, a node:vm context or an iframe. A value built by any of them fails instanceof against this realm's class, so the check takes the wrong branch. This rule only reports values that crossed a boundary in this file: parameters typed unknown or any, results of calling a parameter, and module namespaces from ",[76,77,78],"code",{},"import()"," or ",[76,81,82],{},"ssrLoadModule()",". A parameter of a function that the file neither exports nor passes around is skipped when every call passes a value proven local, such as a literal or an object constructed with an unshadowed built-in. Catching an error does not establish its origin. JavaScript built-ins such as Error and Date are reported by typescript\u002Fboundaries\u002Fno-cross-realm-builtin-instanceof.",[67,85,87],{"id":86},"fix","Fix",[72,89,90],{},"Use a realm-safe intrinsic or a tag shared by the implementations you support where applicable. A member check only narrows to the capabilities it verifies, not the full class. If you need full class semantics, validate or normalize the value at the integration boundary.",[67,92,94],{"id":93},"example","Example",[96,97,99],"h3",{"id":98},"brand-check-values-from-host-callbacks","Brand-check values from host callbacks",[72,101,102],{},"Before",[104,105,110],"pre",{"className":106,"code":107,"language":108,"meta":109,"style":109},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export function toResponse(value: unknown): Response {\n  if (value instanceof Response) return value\n  return Response.json(value)\n}\n","ts","",[76,111,112,153,180,201],{"__ignoreMap":109},[113,114,117,121,125,129,133,137,140,144,147,150],"span",{"class":115,"line":116},"line",1,[113,118,120],{"class":119},"s7zQu","export",[113,122,124],{"class":123},"spNyl"," function",[113,126,128],{"class":127},"s2Zo4"," toResponse",[113,130,132],{"class":131},"sMK4o","(",[113,134,136],{"class":135},"sHdIc","value",[113,138,139],{"class":131},":",[113,141,143],{"class":142},"sBMFI"," unknown",[113,145,146],{"class":131},"):",[113,148,149],{"class":142}," Response",[113,151,152],{"class":131}," {\n",[113,154,156,159,163,166,169,171,174,177],{"class":115,"line":155},2,[113,157,158],{"class":119},"  if",[113,160,162],{"class":161},"swJcz"," (",[113,164,136],{"class":165},"sTEyZ",[113,167,168],{"class":131}," instanceof",[113,170,149],{"class":142},[113,172,173],{"class":161},") ",[113,175,176],{"class":119},"return",[113,178,179],{"class":165}," value\n",[113,181,183,186,188,191,194,196,198],{"class":115,"line":182},3,[113,184,185],{"class":119},"  return",[113,187,149],{"class":165},[113,189,190],{"class":131},".",[113,192,193],{"class":127},"json",[113,195,132],{"class":161},[113,197,136],{"class":165},[113,199,200],{"class":161},")\n",[113,202,204],{"class":115,"line":203},4,[113,205,206],{"class":131},"}\n",[72,208,209],{},"After",[104,211,213],{"className":106,"code":212,"language":108,"meta":109,"style":109},"function isResponse(value: unknown): value is Response {\n  return Object.prototype.toString.call(value) === '[object Response]'\n}\n\nexport function toResponse(value: unknown): Response {\n  if (isResponse(value)) return value\n  return Response.json(value)\n}\n",[76,214,215,243,284,288,294,317,338,355],{"__ignoreMap":109},[113,216,217,220,223,225,227,229,231,233,236,239,241],{"class":115,"line":116},[113,218,219],{"class":123},"function",[113,221,222],{"class":127}," isResponse",[113,224,132],{"class":131},[113,226,136],{"class":135},[113,228,139],{"class":131},[113,230,143],{"class":142},[113,232,146],{"class":131},[113,234,235],{"class":135}," value",[113,237,238],{"class":131}," is",[113,240,149],{"class":142},[113,242,152],{"class":131},[113,244,245,247,250,252,255,257,260,262,265,267,269,271,274,277,281],{"class":115,"line":155},[113,246,185],{"class":119},[113,248,249],{"class":142}," Object",[113,251,190],{"class":131},[113,253,254],{"class":165},"prototype",[113,256,190],{"class":131},[113,258,259],{"class":165},"toString",[113,261,190],{"class":131},[113,263,264],{"class":127},"call",[113,266,132],{"class":161},[113,268,136],{"class":165},[113,270,173],{"class":161},[113,272,273],{"class":131},"===",[113,275,276],{"class":131}," '",[113,278,280],{"class":279},"sfazB","[object Response]",[113,282,283],{"class":131},"'\n",[113,285,286],{"class":115,"line":182},[113,287,206],{"class":131},[113,289,290],{"class":115,"line":203},[113,291,293],{"emptyLinePlaceholder":292},true,"\n",[113,295,297,299,301,303,305,307,309,311,313,315],{"class":115,"line":296},5,[113,298,120],{"class":119},[113,300,124],{"class":123},[113,302,128],{"class":127},[113,304,132],{"class":131},[113,306,136],{"class":135},[113,308,139],{"class":131},[113,310,143],{"class":142},[113,312,146],{"class":131},[113,314,149],{"class":142},[113,316,152],{"class":131},[113,318,320,322,324,327,329,331,334,336],{"class":115,"line":319},6,[113,321,158],{"class":119},[113,323,162],{"class":161},[113,325,326],{"class":127},"isResponse",[113,328,132],{"class":161},[113,330,136],{"class":165},[113,332,333],{"class":161},")) ",[113,335,176],{"class":119},[113,337,179],{"class":165},[113,339,341,343,345,347,349,351,353],{"class":115,"line":340},7,[113,342,185],{"class":119},[113,344,149],{"class":165},[113,346,190],{"class":131},[113,348,193],{"class":127},[113,350,132],{"class":161},[113,352,136],{"class":165},[113,354,200],{"class":161},[113,356,358],{"class":115,"line":357},8,[113,359,206],{"class":131},[67,361,363],{"id":362},"verify-the-fix","Verify the fix",[72,365,366],{},"Run only this rule after editing so the report stays focused on the diagnostic you are closing:",[104,368,372],{"className":369,"code":370,"language":371,"meta":109,"style":109},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm vite-doctor . --extends auto,typescript\u002Fstrict --rules typescript\u002Fboundaries\u002Fno-cross-realm-web-instanceof\n","bash",[76,373,374],{"__ignoreMap":109},[113,375,376,379,382,385,388,391,394],{"class":115,"line":116},[113,377,378],{"class":142},"pnpm",[113,380,381],{"class":279}," vite-doctor",[113,383,384],{"class":279}," .",[113,386,387],{"class":279}," --extends",[113,389,390],{"class":279}," auto,typescript\u002Fstrict",[113,392,393],{"class":279}," --rules",[113,395,396],{"class":279}," typescript\u002Fboundaries\u002Fno-cross-realm-web-instanceof\n",[67,398,400],{"id":399},"useful-links","Useful links",[402,403,404],"ul",{},[405,406,407],"li",{},[408,409,412],"a",{"href":58,"rel":410},[411],"nofollow","Upstream docs",[67,414,416],{"id":415},"related-rule","Related rule",[402,418,419],{},[405,420,421],{},[408,422,423],{"href":62},[76,424,61],{},[426,427,428],"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 .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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .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 .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}",{"title":109,"searchDepth":155,"depth":155,"links":430},[431,432,433,436,437,438],{"id":69,"depth":155,"text":70},{"id":86,"depth":155,"text":87},{"id":93,"depth":155,"text":94,"children":434},[435],{"id":98,"depth":182,"text":99},{"id":362,"depth":155,"text":363},{"id":399,"depth":155,"text":400},{"id":415,"depth":155,"text":416},"TS0013","Report instanceof checks against web platform and binary data classes, such as Response, Request, Blob, URL, ArrayBuffer and Uint8Array, on values that may come from another JavaScript realm or another copy of the class.","md","typescript",{},"\u002Fdiagnostics\u002Fts0013",{"title":50,"description":440},"diagnostics\u002FTS0013","Response, Request, Headers, Blob, URL, ArrayBuffer, Uint8Array and the other web platform classes have one constructor per realm, and often more than one per process: a second copy of undici such as Miniflare's, the Blob and URL of a Vitest DOM environment, a node:vm context or an iframe. A value built by any of them fails instanceof against this realm's class, so the check takes the wrong branch. This rule only reports values that crossed a boundary in this file: parameters typed unknown or any, results of calling a parameter, and module namespaces from import() or ssrLoadModule(). A parameter of a function that the file neither exports nor passes around is skipped when every call passes a value proven local, such as a literal or an object constructed with an unshadowed built-in. Catching an error does not establish its origin. JavaScript built-ins such as Error and Date are reported by typescript\u002Fboundaries\u002Fno-cross-realm-builtin-instanceof.","1nizgMiRWP7hZY8HSoKpsqhnK-c-slAEY1PToW-RJH8",1795268816012]