Skip to content

Commit

Permalink
chore: remove usage of querystring
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Jul 21, 2021
1 parent 0693d03 commit 9743e6e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/vite/src/node/plugins/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@ import { ResolvedConfig } from '../config'
import { Plugin } from '../plugin'
import { resolvePlugins } from '../plugins'
import { parse as parseUrl } from 'url'
import qs, { ParsedUrlQuery } from 'querystring'
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 9743e6e

Please sign in to comment.