parse-gh-branch-identifier
Parse a branch identifier string that is available for Github commit comparison API
Installation
Package managers
npm
npm install parse-gh-branch-identifier
Bower
bower install parse-gh-branch-identifier
Standalone
Download the script file directly.
API
parseGhBranchIdentifier(str)
str: String
(branch
or username:branch
style string)
Return: Object
({[username: ...,] branch: ...}
)
It extracts a branch name (and username if available) from a branch
or username:branch
string and creates an object.
;//=> {branch: 'patch-1'} ;//=> {username: 'shinnn', branch: 'patch-1'}
License
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.