parse-gh-branch-identifier
v1.0.0
Published
Parse a branch identifier string that is available for Github commit comparison API
Downloads
3
Maintainers
Readme
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.
parseGhBranchIdentifier('patch-1');
//=> {branch: 'patch-1'}
parseGhBranchIdentifier('shinnn:patch-1');
//=> {username: 'shinnn', branch: 'patch-1'}
License
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.