fixes #668
This commit is contained in:
parent
1451c3ff70
commit
4a2d6d3035
2 changed files with 3 additions and 3 deletions
|
@ -71,8 +71,8 @@ function validate(formProps) {
|
||||||
|
|
||||||
if (!formProps.name) {
|
if (!formProps.name) {
|
||||||
errors.name = 'Please enter a name';
|
errors.name = 'Please enter a name';
|
||||||
} else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$)/i)) {
|
} else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$|.+\.tsv$)/i)) {
|
||||||
errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, or CSV.';
|
errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, CSV, or TSV.';
|
||||||
}
|
}
|
||||||
|
|
||||||
return errors;
|
return errors;
|
||||||
|
|
|
@ -20,7 +20,7 @@ export const MEDIA_FILE_QUOTED_REGEX =
|
||||||
|
|
||||||
export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
|
export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
|
||||||
// these are files that have to be linked to with a blob url
|
// these are files that have to be linked to with a blob url
|
||||||
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag)$/i;
|
export const PLAINTEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|tsv)$/i;
|
||||||
// these are files that users would want to edit as text (maybe svg should be here?)
|
// these are files that users would want to edit as text (maybe svg should be here?)
|
||||||
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|js|css|html|htm|jsx)$/i;
|
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|js|css|html|htm|jsx)$/i;
|
||||||
export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;
|
export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;
|
||||||
|
|
Loading…
Reference in a new issue