jonschlinkert / parse-github-url

Parse a Github URL into an object. Supports a wide variety of GitHub URL formats.
MIT License
121 stars 21 forks source link

Parse Blob URL #17

Closed septs closed 3 years ago

septs commented 4 years ago
Welcome to Node.js v14.11.0.
Type ".help" for more information.
> parse = require('parse-github-url')
[Function: parseGithubUrl]
> parse('https://github.com/tc39/notes/blob/4ea41d0d11292c3a4788040bb822e7a6d88784de/meetings/2020-07/july-21.md#intllistformat-for-stage-4')
Url {
  protocol: 'https:',
  slashes: true,
  auth: null,
  host: 'github.com',
  port: null,
  hostname: 'github.com',
  hash: '#intllistformat-for-stage-4',
  search: null,
  query: null,
  pathname: 'tc39/notes/blob/4ea41d0d11292c3a4788040bb822e7a6d88784de/meetings/2020-07/july-21.md',
  path: 'tc39/notes/blob/4ea41d0d11292c3a4788040bb822e7a6d88784de/meetings/2020-07/july-21.md',
  href: 'https://github.com/tc39/notes/blob/4ea41d0d11292c3a4788040bb822e7a6d88784de/meetings/2020-07/july-21.md#intllistformat-for-stage-4',
  filepath: '4ea41d0d11292c3a4788040bb822e7a6d88784de/meetings/2020-07/july-21.md',
  blob: '4ea41d0d11292c3a4788040bb822e7a6d88784de/meetings/2020-07/july-21.md#intllistformat-for-stage-4',
  owner: 'tc39',
  name: 'notes',
  repo: 'tc39/notes',
  branch: 'blob',
  repository: 'tc39/notes'
}
>

branch is unexpected result.

raineorshine commented 3 years ago

Reason for closing? PR is still unmerged.