[{"data":1,"prerenderedAt":435},["ShallowReactive",2],{"navigation_docs":3,"rule-content-\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-web-instanceof":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,"description":423,"diagnosticCodes":424,"docsUrl":59,"extension":425,"fix":60,"framework":426,"meta":427,"navigation":428,"pack":61,"path":430,"recommendedReplacement":131,"ruleId":62,"seo":431,"severity":63,"source":64,"sourceUrl":65,"stem":432,"why":433,"__hash__":434},"rules\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-web-instanceof.md","Do not use instanceof for web platform values from another realm",{"type":52,"value":53,"toc":414},"minimark",[54,66,71,109,113,125,129,132,136,148,152,157,160,258,261,410],[55,56],"rule-metadata",{"category":57,"diagnosticCodes":58,"docsUrl":59,"fix":60,"pack":61,"ruleId":62,"severity":63,"source":64,"sourceUrl":65},"boundaries","TS0013","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","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},"run-this-rule","Run this rule",[72,73,78],"pre",{"className":74,"code":75,"language":76,"meta":77,"style":77},"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","",[79,80,81],"code",{"__ignoreMap":77},[82,83,86,90,94,97,100,103,106],"span",{"class":84,"line":85},"line",1,[82,87,89],{"class":88},"sBMFI","pnpm",[82,91,93],{"class":92},"sfazB"," vite-doctor",[82,95,96],{"class":92}," .",[82,98,99],{"class":92}," --extends",[82,101,102],{"class":92}," auto,typescript\u002Fstrict",[82,104,105],{"class":92}," --rules",[82,107,108],{"class":92}," typescript\u002Fboundaries\u002Fno-cross-realm-web-instanceof\n",[67,110,112],{"id":111},"why-it-matters","Why it matters",[114,115,116,117,120,121,124],"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 ",[79,118,119],{},"import()"," or ",[79,122,123],{},"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,126,128],{"id":127},"recommended-fix","Recommended fix",[114,130,131],{},"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,133,135],{"id":134},"useful-links","Useful links",[137,138,139],"ul",{},[140,141,142],"li",{},[143,144,147],"a",{"href":59,"rel":145},[146],"nofollow","Rule reference",[67,149,151],{"id":150},"example","Example",[153,154,156],"h3",{"id":155},"brand-check-values-from-host-callbacks","Brand-check values from host callbacks",[114,158,159],{},"Before",[72,161,165],{"className":162,"code":163,"language":164,"meta":77,"style":77},"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",[79,166,167,204,231,252],{"__ignoreMap":77},[82,168,169,173,177,181,185,189,192,195,198,201],{"class":84,"line":85},[82,170,172],{"class":171},"s7zQu","export",[82,174,176],{"class":175},"spNyl"," function",[82,178,180],{"class":179},"s2Zo4"," toResponse",[82,182,184],{"class":183},"sMK4o","(",[82,186,188],{"class":187},"sHdIc","value",[82,190,191],{"class":183},":",[82,193,194],{"class":88}," unknown",[82,196,197],{"class":183},"):",[82,199,200],{"class":88}," Response",[82,202,203],{"class":183}," {\n",[82,205,207,210,214,217,220,222,225,228],{"class":84,"line":206},2,[82,208,209],{"class":171},"  if",[82,211,213],{"class":212},"swJcz"," (",[82,215,188],{"class":216},"sTEyZ",[82,218,219],{"class":183}," instanceof",[82,221,200],{"class":88},[82,223,224],{"class":212},") ",[82,226,227],{"class":171},"return",[82,229,230],{"class":216}," value\n",[82,232,234,237,239,242,245,247,249],{"class":84,"line":233},3,[82,235,236],{"class":171},"  return",[82,238,200],{"class":216},[82,240,241],{"class":183},".",[82,243,244],{"class":179},"json",[82,246,184],{"class":212},[82,248,188],{"class":216},[82,250,251],{"class":212},")\n",[82,253,255],{"class":84,"line":254},4,[82,256,257],{"class":183},"}\n",[114,259,260],{},"After",[72,262,264],{"className":162,"code":263,"language":164,"meta":77,"style":77},"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",[79,265,266,294,334,338,344,367,388,405],{"__ignoreMap":77},[82,267,268,271,274,276,278,280,282,284,287,290,292],{"class":84,"line":85},[82,269,270],{"class":175},"function",[82,272,273],{"class":179}," isResponse",[82,275,184],{"class":183},[82,277,188],{"class":187},[82,279,191],{"class":183},[82,281,194],{"class":88},[82,283,197],{"class":183},[82,285,286],{"class":187}," value",[82,288,289],{"class":183}," is",[82,291,200],{"class":88},[82,293,203],{"class":183},[82,295,296,298,301,303,306,308,311,313,316,318,320,322,325,328,331],{"class":84,"line":206},[82,297,236],{"class":171},[82,299,300],{"class":88}," Object",[82,302,241],{"class":183},[82,304,305],{"class":216},"prototype",[82,307,241],{"class":183},[82,309,310],{"class":216},"toString",[82,312,241],{"class":183},[82,314,315],{"class":179},"call",[82,317,184],{"class":212},[82,319,188],{"class":216},[82,321,224],{"class":212},[82,323,324],{"class":183},"===",[82,326,327],{"class":183}," '",[82,329,330],{"class":92},"[object Response]",[82,332,333],{"class":183},"'\n",[82,335,336],{"class":84,"line":233},[82,337,257],{"class":183},[82,339,340],{"class":84,"line":254},[82,341,343],{"emptyLinePlaceholder":342},true,"\n",[82,345,347,349,351,353,355,357,359,361,363,365],{"class":84,"line":346},5,[82,348,172],{"class":171},[82,350,176],{"class":175},[82,352,180],{"class":179},[82,354,184],{"class":183},[82,356,188],{"class":187},[82,358,191],{"class":183},[82,360,194],{"class":88},[82,362,197],{"class":183},[82,364,200],{"class":88},[82,366,203],{"class":183},[82,368,370,372,374,377,379,381,384,386],{"class":84,"line":369},6,[82,371,209],{"class":171},[82,373,213],{"class":212},[82,375,376],{"class":179},"isResponse",[82,378,184],{"class":212},[82,380,188],{"class":216},[82,382,383],{"class":212},")) ",[82,385,227],{"class":171},[82,387,230],{"class":216},[82,389,391,393,395,397,399,401,403],{"class":84,"line":390},7,[82,392,236],{"class":171},[82,394,200],{"class":216},[82,396,241],{"class":183},[82,398,244],{"class":179},[82,400,184],{"class":212},[82,402,188],{"class":216},[82,404,251],{"class":212},[82,406,408],{"class":84,"line":407},8,[82,409,257],{"class":183},[411,412,413],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .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 .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}",{"title":77,"searchDepth":206,"depth":206,"links":415},[416,417,418,419,420],{"id":69,"depth":206,"text":70},{"id":111,"depth":206,"text":112},{"id":127,"depth":206,"text":128},{"id":134,"depth":206,"text":135},{"id":150,"depth":206,"text":151,"children":421},[422],{"id":155,"depth":233,"text":156},"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.",[58],"md","typescript",{},{"title":429},"Web API instanceof","\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-web-instanceof",{"title":50,"description":423},"typescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-web-instanceof","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.","efktMio03CYzy37PNZs_zvdd8A3PIUn-GPScrDzMAhs",1795268793298]