is-git-branch-name-valid

Check that a git branch name is well formed

MIT 2 个版本
安装
npm install is-git-branch-name-valid
yarn add is-git-branch-name-valid
pnpm add is-git-branch-name-valid
bun add is-git-branch-name-valid
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

版本列表
1.0.1 2020-11-28
1.0.0 2020-11-28