[{"data":1,"prerenderedAt":499},["ShallowReactive",2],{"navigation_docs":3,"rule-content-\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-prototype-identity":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":486,"diagnosticCodes":487,"docsUrl":59,"extension":488,"fix":60,"framework":489,"meta":490,"navigation":491,"pack":61,"path":493,"recommendedReplacement":494,"ruleId":62,"seo":495,"severity":63,"source":64,"sourceUrl":65,"stem":496,"why":497,"__hash__":498},"rules\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-prototype-identity.md","Do not compare prototypes of values from another realm",{"type":52,"value":53,"toc":477},"minimark",[54,66,71,109,113,129,133,144,148,160,164,169,172,344,347,473],[55,56],"rule-metadata",{"category":57,"diagnosticCodes":58,"docsUrl":59,"fix":60,"pack":61,"ruleId":62,"severity":63,"source":64,"sourceUrl":65},"boundaries","TS0014","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-prototype-identity","warn","src\u002Frule-packs\u002Ftypescript\u002Frules\u002Fno-cross-realm-prototype-identity.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Ftypescript\u002Frules\u002Fno-cross-realm-prototype-identity.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-prototype-identity\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-prototype-identity\n",[67,110,112],{"id":111},"why-it-matters","Why it matters",[114,115,116,117,120,121,124,125,128],"p",{},"Every realm has its own Object.prototype, Array.prototype and built-in constructors. A plain object or array created by the Vite module runner, workerd or miniflare, or a Vitest environment has that realm's prototype, so Object.",[79,118,119],{},"getPrototypeOf(value)"," === Object.prototype or value.constructor === Array is false and the check rejects or misroutes it. 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,122,123],{},"import()"," or ",[79,126,127],{},"ssrLoadModule()",".",[67,130,132],{"id":131},"recommended-fix","Recommended fix",[114,134,135,136,139,140,143],{},"Avoid realm identity: use Array.",[79,137,138],{},"isArray(value)"," for arrays, Object.",[79,141,142],{},"getPrototypeOf(prototype)"," === null for plain objects, or a tag shared by the implementations you support where applicable. Narrow only to the capabilities a member check verifies. If you need full class semantics, validate or normalize the value at the integration boundary.",[67,145,147],{"id":146},"useful-links","Useful links",[149,150,151],"ul",{},[152,153,154],"li",{},[155,156,159],"a",{"href":59,"rel":157},[158],"nofollow","Rule reference",[67,161,163],{"id":162},"example","Example",[165,166,168],"h3",{"id":167},"check-plain-objects-without-objectprototype","Check plain objects without Object.prototype",[114,170,171],{},"Before",[72,173,177],{"className":174,"code":175,"language":176,"meta":77,"style":77},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export function isPlainObject(value: unknown): value is Record\u003Cstring, unknown> {\n  if (typeof value !== 'object' || value === null) return false\n  const prototype = Object.getPrototypeOf(value)\n  return prototype === Object.prototype || prototype === null\n}\n","ts",[79,178,179,236,285,312,338],{"__ignoreMap":77},[82,180,181,185,189,193,197,201,204,207,210,213,216,219,222,225,228,230,233],{"class":84,"line":85},[82,182,184],{"class":183},"s7zQu","export",[82,186,188],{"class":187},"spNyl"," function",[82,190,192],{"class":191},"s2Zo4"," isPlainObject",[82,194,196],{"class":195},"sMK4o","(",[82,198,200],{"class":199},"sHdIc","value",[82,202,203],{"class":195},":",[82,205,206],{"class":88}," unknown",[82,208,209],{"class":195},"):",[82,211,212],{"class":199}," value",[82,214,215],{"class":195}," is",[82,217,218],{"class":88}," Record",[82,220,221],{"class":195},"\u003C",[82,223,224],{"class":88},"string",[82,226,227],{"class":195},",",[82,229,206],{"class":88},[82,231,232],{"class":195},">",[82,234,235],{"class":195}," {\n",[82,237,239,242,246,249,252,255,258,261,264,267,269,272,275,278,281],{"class":84,"line":238},2,[82,240,241],{"class":183},"  if",[82,243,245],{"class":244},"swJcz"," (",[82,247,248],{"class":195},"typeof",[82,250,212],{"class":251},"sTEyZ",[82,253,254],{"class":195}," !==",[82,256,257],{"class":195}," '",[82,259,260],{"class":92},"object",[82,262,263],{"class":195},"'",[82,265,266],{"class":195}," ||",[82,268,212],{"class":251},[82,270,271],{"class":195}," ===",[82,273,274],{"class":195}," null",[82,276,277],{"class":244},") ",[82,279,280],{"class":183},"return",[82,282,284],{"class":283},"sfNiH"," false\n",[82,286,288,291,294,297,300,302,305,307,309],{"class":84,"line":287},3,[82,289,290],{"class":187},"  const",[82,292,293],{"class":251}," prototype",[82,295,296],{"class":195}," =",[82,298,299],{"class":251}," Object",[82,301,128],{"class":195},[82,303,304],{"class":191},"getPrototypeOf",[82,306,196],{"class":244},[82,308,200],{"class":251},[82,310,311],{"class":244},")\n",[82,313,315,318,320,322,324,326,329,331,333,335],{"class":84,"line":314},4,[82,316,317],{"class":183},"  return",[82,319,293],{"class":251},[82,321,271],{"class":195},[82,323,299],{"class":88},[82,325,128],{"class":195},[82,327,328],{"class":251},"prototype",[82,330,266],{"class":195},[82,332,293],{"class":251},[82,334,271],{"class":195},[82,336,337],{"class":195}," null\n",[82,339,341],{"class":84,"line":340},5,[82,342,343],{"class":195},"}\n",[114,345,346],{},"After",[72,348,350],{"className":174,"code":349,"language":176,"meta":77,"style":77},"export function isPlainObject(value: unknown): value is Record\u003Cstring, unknown> {\n  if (typeof value !== 'object' || value === null) return false\n  const prototype = Object.getPrototypeOf(value)\n  return prototype === null || Object.getPrototypeOf(prototype) === null\n}\n",[79,351,352,388,420,440,469],{"__ignoreMap":77},[82,353,354,356,358,360,362,364,366,368,370,372,374,376,378,380,382,384,386],{"class":84,"line":85},[82,355,184],{"class":183},[82,357,188],{"class":187},[82,359,192],{"class":191},[82,361,196],{"class":195},[82,363,200],{"class":199},[82,365,203],{"class":195},[82,367,206],{"class":88},[82,369,209],{"class":195},[82,371,212],{"class":199},[82,373,215],{"class":195},[82,375,218],{"class":88},[82,377,221],{"class":195},[82,379,224],{"class":88},[82,381,227],{"class":195},[82,383,206],{"class":88},[82,385,232],{"class":195},[82,387,235],{"class":195},[82,389,390,392,394,396,398,400,402,404,406,408,410,412,414,416,418],{"class":84,"line":238},[82,391,241],{"class":183},[82,393,245],{"class":244},[82,395,248],{"class":195},[82,397,212],{"class":251},[82,399,254],{"class":195},[82,401,257],{"class":195},[82,403,260],{"class":92},[82,405,263],{"class":195},[82,407,266],{"class":195},[82,409,212],{"class":251},[82,411,271],{"class":195},[82,413,274],{"class":195},[82,415,277],{"class":244},[82,417,280],{"class":183},[82,419,284],{"class":283},[82,421,422,424,426,428,430,432,434,436,438],{"class":84,"line":287},[82,423,290],{"class":187},[82,425,293],{"class":251},[82,427,296],{"class":195},[82,429,299],{"class":251},[82,431,128],{"class":195},[82,433,304],{"class":191},[82,435,196],{"class":244},[82,437,200],{"class":251},[82,439,311],{"class":244},[82,441,442,444,446,448,450,452,454,456,458,460,462,464,467],{"class":84,"line":314},[82,443,317],{"class":183},[82,445,293],{"class":251},[82,447,271],{"class":195},[82,449,274],{"class":195},[82,451,266],{"class":195},[82,453,299],{"class":251},[82,455,128],{"class":195},[82,457,304],{"class":191},[82,459,196],{"class":244},[82,461,328],{"class":251},[82,463,277],{"class":244},[82,465,466],{"class":195},"===",[82,468,337],{"class":195},[82,470,471],{"class":84,"line":340},[82,472,343],{"class":195},[474,475,476],"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}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":77,"searchDepth":238,"depth":238,"links":478},[479,480,481,482,483],{"id":69,"depth":238,"text":70},{"id":111,"depth":238,"text":112},{"id":131,"depth":238,"text":132},{"id":146,"depth":238,"text":147},{"id":162,"depth":238,"text":163,"children":484},[485],{"id":167,"depth":287,"text":168},"Report prototype and constructor identity checks against built-in classes on values that may come from another JavaScript realm.",[58],"md","typescript",{},{"title":492},"Prototype identity","\u002Ftypescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-prototype-identity","Avoid realm identity: use Array.isArray(value) for arrays, Object.getPrototypeOf(prototype) === null for plain objects, or a tag shared by the implementations you support where applicable. Narrow only to the capabilities a member check verifies. If you need full class semantics, validate or normalize the value at the integration boundary.",{"title":50,"description":486},"typescript\u002Frules\u002Fboundaries\u002Fno-cross-realm-prototype-identity","Every realm has its own Object.prototype, Array.prototype and built-in constructors. A plain object or array created by the Vite module runner, workerd or miniflare, or a Vitest environment has that realm's prototype, so Object.getPrototypeOf(value) === Object.prototype or value.constructor === Array is false and the check rejects or misroutes it. 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().","HQUJFG02Sttwu1yyD7yMH8vMV4husg-tIPVq4QW52Ts",1795268793212]