This commit is contained in:
Cassie Tarakajian 2018-08-29 15:06:41 -04:00
parent 1451c3ff70
commit 4a2d6d3035
2 changed files with 3 additions and 3 deletions

View file

@ -71,8 +71,8 @@ function validate(formProps) {
if (!formProps.name) {
errors.name = 'Please enter a name';
} else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$)/i)) {
errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, or CSV.';
} else if (!formProps.name.match(/(.+\.js$|.+\.css$|.+\.json$|.+\.txt$|.+\.csv$|.+\.tsv$)/i)) {
errors.name = 'File must be of type JavaScript, CSS, JSON, TXT, CSV, or TSV.';
}
return errors;

View file

@ -20,7 +20,7 @@ export const MEDIA_FILE_QUOTED_REGEX =
export const STRING_REGEX = /(['"])((\\\1|.)*?)\1/gm;
// 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?)
export const TEXT_FILE_REGEX = /.+\.(json|txt|csv|vert|frag|js|css|html|htm|jsx)$/i;
export const NOT_EXTERNAL_LINK_REGEX = /^(?!(http:\/\/|https:\/\/))/;