Skip to content

Owner is parsed incorrectly when GitHub user name is a hex number, e.g., '0xABC' #135

@ronyeh

Description

@ronyeh

Repro:

const GitUrlParse = require("git-url-parse");

const a = GitUrlParse("[email protected]:0xABCDEF/myreponame.git");
const b = GitUrlParse("[email protected]:1xABCDEF/myreponame.git");
const c = GitUrlParse("[email protected]:zxABCDEF/myreponame.git");

console.log(a.owner, a.full_name); // BUGGY => git git/myreponame
console.log(b.owner, b.full_name); // OK => 1xABCDEF 1xABCDEF/myreponame
console.log(c.owner, c.full_name); // OK => zxABCDEF zxABCDEF/myreponame

I have a git url to parse where the owner's GitHub user name is a hexadecimal number. :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions