is-gitlab-url
Check if a passed string is a valid Gitlab URL
Unlike is-git-url, is-gitlab-url is a domain-specific validator. It returns true
if passed URL is a part of gitlab.com
domain only.
Installation
$ npm install is-gitlab-url --save
Usage
var isGitlabUrl = ; // Valid examples; // => true; // => true;// => true;// => true;// => true // Invalid examples; // => false;// => false;// => false // Repository mode can be used to check whether a passed URL// is a valid repository URL;// => true;// => false;// => false // Strict mode is used to validate URLs before cloning// Strict mode turns on automatically if URL contains git protocol;// => true;// => false
API
isGitlabUrl(url, [options])
Check if a passed string is a valid GitHub URL
Params
- String
url
: A string to be validated - Object
options
: An object containing the following fields:strict
(Boolean): Match only URLs ending with .gitrepository
(Boolean): Match only valid GitHub repo URLs
License
MIT © Giacomo Rossetto