UNPKG

bit-bin

Version:

<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b

26 lines (19 loc) 642 B
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = isValidScopeName; function _isString() { const data = _interopRequireDefault(require("./string/is-string")); _isString = function () { return data; }; return data; } // the '.' can be in the middle, not at the beginning and not at the end and only once. const validationRegExp = /^[$\-_!a-z0-9]+[.]?[$\-_!a-z0-9]+$/; function isValidScopeName(val) { if (!(0, _isString().default)(val)) return false; return validationRegExp.test(val); }