Skip to content

Commit

Permalink
chore: remove usage of querystring (#4342)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Jul 21, 2021
1 parent 0693d03 commit 828a8e5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/vite/src/node/plugins/worker.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import { ResolvedConfig } from '../config'
import { Plugin } from '../plugin'
import { resolvePlugins } from '../plugins'
import { parse as parseUrl } from 'url'
import qs, { ParsedUrlQuery } from 'querystring'
import { parse as parseUrl, URLSearchParams } from 'url'
import { fileToUrl, getAssetHash } from './asset'
import { cleanUrl, injectQuery } from '../utils'
import Rollup from 'rollup'
import { ENV_PUBLIC_PATH } from '../constants'
import path from 'path'

function parseWorkerRequest(id: string): ParsedUrlQuery | null {
function parseWorkerRequest(id: string): Record<string, string> | null {
const { search } = parseUrl(id)
if (!search) {
return null
}
return qs.parse(search.slice(1))
return Object.fromEntries(new URLSearchParams(search.slice(1)))
}

const WorkerFileId = 'worker_file'
Expand Down

0 comments on commit 828a8e5

Please sign in to comment.