Détail du package

is-git-branch-name-valid

vweevers2.6kMIT1.0.1

Check that a git branch name is well formed

branch, git, refname, validate

readme

is-git-branch-name-valid

Check that a git branch name is well formed.

npm status node Test JavaScript Style Guide

Usage

const validBranch = require('is-git-branch-name-valid')

validBranch('foo.bar')     // true
validBranch('foo-bar/baz') // true
validBranch('foo^bar')     // false
validBranch('HEAD')        // false
validBranch('-foo')        // false

API

validBranch(name)

Takes a string name. Returns true if name:

  1. Is a valid reference name
  2. Does not equal HEAD or start with -.

Install

With npm do:

npm install is-git-branch-name-valid

License

MIT © Vincent Weevers