Skip to content

Commit

Permalink
remove unsed
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Oct 29, 2022
1 parent ddce753 commit 410df8e
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions packages/next/server/render.tsx
Expand Up @@ -411,30 +411,6 @@ export async function renderToHTML(
// next internal queries should be stripped out
stripInternalQueries(query)

const callMiddleware = async (method: string, args: any[], props = false) => {
let results: any = props ? {} : []

if ((Document as any)[`${method}Middleware`]) {
let middlewareFunc = await (Document as any)[`${method}Middleware`]
middlewareFunc = middlewareFunc.default || middlewareFunc

const curResults = await middlewareFunc(...args)
if (props) {
for (const result of curResults) {
results = {
...results,
...result,
}
}
} else {
results = curResults
}
}
return results
}

const headTags = (...args: any) => callMiddleware('headTags', args)

const isSSG = !!getStaticProps
const isBuildTimeSSG = isSSG && renderOpts.nextExport
const defaultAppGetInitialProps =
Expand Down

0 comments on commit 410df8e

Please sign in to comment.