Package Exports
- is-git-ref-name-valid
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (is-git-ref-name-valid) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
is-git-ref-name-valid
Check that a git reference name is well formed, per git-check-ref-format(1).
Usage
const validRef = require('is-git-ref-name-valid')
validRef('refs/heads/foo.bar') // true
validRef('refs/heads/foo^bar') // falseSame as git check-ref-format, the reference name must contain a / by default. This can be disabled:
validRef('ünicöde') // false
validRef('ünicöde', true) // trueTo validate branch names, for which there are additional rules, use is-git-branch-name-valid.
API
validRef(name[, onelevel])
Takes a string name and an optional onelevel boolean. Returns true if name is well formed. Throws if name is not a string. If onelevel is true then name does not have to contain a /.
Install
With npm do:
npm install is-git-ref-name-validLicense
MIT © Vincent Weevers