Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getErrors: function () {
if (!this.mountpathre || !this.pathre) {
this.mountpathre = xRegExp.build('^(?:(?:\\/)|(?:(?:[\\/]{{char}}+)+))$', { char: '[_0-9\\p{L}\\-\\.\\s]' });
this.pathre = xRegExp.build('^(?:[a-zA-Z]\\:|[\\/])(?:[\\/]{{char}}+)+$', { char: '[_0-9\\p{L}\\-\\.\\s]' });
}
var errors = {
mountpath: !this.mountpathre.test(this.state.edit.mountpath),
path: !this.pathre.test(this.state.edit.path),
type: !(/music|path/.test(this.state.edit.type)),
messages: []
};
if (this.state.edit.mountpath !== '' || this.state.edit.path !== '' || this.state.edit.type !== '') {
if (errors.mountpath) {
errors.messages.push('The mount path expected, e.g. /music/retro');
}
getErrors: function () {
if (!this.mountpathre || !this.pathre) {
this.mountpathre = xRegExp.build('^(?:(?:\\/)|(?:(?:[\\/]{{char}}+)+))$', { char: '[_0-9\\p{L}\\-\\.\\s]' });
this.pathre = xRegExp.build('^(?:[a-zA-Z]\\:|[\\/])(?:[\\/]{{char}}+)+$', { char: '[_0-9\\p{L}\\-\\.\\s]' });
}
var errors = {
mountpath: !this.mountpathre.test(this.state.edit.mountpath),
path: !this.pathre.test(this.state.edit.path),
type: !(/music|path/.test(this.state.edit.type)),
messages: []
};
if (this.state.edit.mountpath !== '' || this.state.edit.path !== '' || this.state.edit.type !== '') {
if (errors.mountpath) {
errors.messages.push('The mount path expected, e.g. /music/retro');
}
if (errors.path) {