parse-gh-branch-identifier

1.0.0 • Public • Published

parse-gh-branch-identifier

NPM version Bower version Build Status Coverage Status Dependency Status devDependency Status

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.

Package Sidebar

Install

npm i parse-gh-branch-identifier

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • shinnn