Skip to content

Commit

Permalink
chore(types): remove unnecessary type assertions (#4356)
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz authored Jul 22, 2021
1 parent 9dab51d commit a1f6ac9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export async function createServer(
transformRequest(url, options) {
return transformRequest(url, server, options)
},
transformIndexHtml: null as any,
transformIndexHtml: null!, // to be immediately set
ssrLoadModule(url) {
if (!server._ssrExternals) {
server._ssrExternals = resolveSSRExternal(
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/ssr/ssrStacktrace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function ssrRewriteStacktrace(
}

const consumer = new SourceMapConsumer(
rawSourceMap as any as RawSourceMap
rawSourceMap as unknown as RawSourceMap
)

const pos = consumer.originalPositionFor({
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/ssr/ssrTransform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ export async function ssrTransform(

// export * from './foo'
if (node.type === 'ExportAllDeclaration') {
if ((node as any).exported) {
if (node.exported) {
const importId = defineImport(node, node.source.value as string)
defineExport((node as any).exported.name, `${importId}`)
defineExport(node.exported.name, `${importId}`)
s.remove(node.start, node.end)
} else {
const importId = defineImport(node, node.source.value as string)
Expand Down

0 comments on commit a1f6ac9

Please sign in to comment.