File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
packages/cloudflare/src/cli/build/patches/to-investigate Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -107,18 +107,22 @@ function patchRequireReactDomServerEdge(config: Config) {
107107 const parameterName = p [ 0 ] ! . getName ( ) ;
108108 const bodyChildren = arrowFunction . getBody ( ) . getChildren ( ) ;
109109 if (
110- bodyChildren . length !== 3 ||
111- bodyChildren [ 0 ] ! . getFullText ( ) !== "{" ||
112- bodyChildren [ 2 ] ! . getFullText ( ) !== "}"
110+ ! (
111+ bodyChildren . length === 3 &&
112+ bodyChildren [ 0 ] ! . getFullText ( ) === "{" &&
113+ bodyChildren [ 2 ] ! . getFullText ( ) === "}"
114+ )
113115 ) {
114116 return ;
115117 }
116118 const bodyStatements = bodyChildren [ 1 ] ?. getChildren ( ) ;
117119
118120 // the function has only two statements: "use strict" and e.exports=require("react-dom/server.edge")
119121 if (
120- bodyStatements ?. length !== 2 ||
121- bodyStatements . some ( ( statement ) => ! statement . isKind ( ts . SyntaxKind . ExpressionStatement ) )
122+ ! (
123+ bodyStatements ?. length === 2 &&
124+ bodyStatements . every ( ( statement ) => statement . isKind ( ts . SyntaxKind . ExpressionStatement ) )
125+ )
122126 ) {
123127 return ;
124128 }
You can’t perform that action at this time.
0 commit comments