'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = isValidIdChunk;

var _isString;

function _load_isString() {
  return _isString = _interopRequireDefault(require('./string/is-string'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var validationRegExp = /^[$\-_!a-z0-9/]+$/;
var validationRegExpDisallowSlash = /^[$\-_!a-z0-9]+$/;


function isValidIdChunk(val) {
  var allowSlash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;

  if (!(0, (_isString || _load_isString()).default)(val)) return false;
  return allowSlash ? validationRegExp.test(val) : validationRegExpDisallowSlash.test(val);
}