parse-user-branch
v1.0.0
Published
Parse a username:branch string that is available for Github commit comparison API
Downloads
4
Maintainers
Readme
parse-user-branch
Parse a username:branch
string that is available for Github commit comparison API
Installation
Package managers
npm
npm install parse-user-branch
Bower
bower install parse-user-branch
Standalone
Download the script file directly.
API
parseUserBranch(str)
str: String
(username:branch
style branch expression, for example https://github.com/isaacs/nyc/tree/dep-update → 'isaacs:dep-update'
)
Return: Object
({username: ..., branch: ...}
)
It extracts a username and a branch name from a username/branch
string and creates an object.
parseUserBranch('shinnn:patch-1');
//=> {username: 'shinnn', branch: 'patch-1'}
License
Copyright (c) 2016 Shinnosuke Watanabe
Licensed under the MIT License.