huan/file-box

Get rid of deprecated Node.js API: url.parse

開放

#20 建立於 2019年6月22日

 (0 則留言) (0 個反應) (0 位負責人)TypeScript (9 個分叉)user submission
bughelp wanted

倉庫指標

星標
 (58 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

https://github.com/huan/file-box/blob/3788e591fad15a2ec00868a3150d1e136e3898dc/src/misc.ts#L90-L98

If we use new url.URL() to replace url.parse, the unit tests will fail, and the reason still needs to be found.

url.parse

Url {
  protocol: 'https:',
  slashes: true,
  auth: null,
  host: 'httpbin.org',
  port: null,
  hostname: 'httpbin.org',
  hash: null,
  search: null,
  query: null,
  pathname: '/headers',
  path: '/headers',
  href: 'https://httpbin.org/headers' }

new url.URL

URL {
  href: 'https://httpbin.org/headers',
  origin: 'https://httpbin.org',
  protocol: 'https:',
  username: '',
  password: '',
  host: 'httpbin.org',
  hostname: 'httpbin.org',
  port: '',
  pathname: '/headers',
  search: '',
  searchParams: URLSearchParams {},
  hash: '' }
https://httpbin.org/headers

貢獻者指南