pull/7664/head
Yuichiro Yamashita 4 years ago
parent 87c8f3631e
commit 08bf958df2

@ -19,11 +19,11 @@ export default function get_name_from_filename(filename: string) {
const base = parts const base = parts
.pop() .pop()
.replace(regex_percentage_characters, "u") .replace(regex_percentage_characters, 'u')
.replace(regex_file_ending, "") .replace(regex_file_ending, '')
.replace(regex_repeated_invalid_variable_identifier_characters, "_") .replace(regex_repeated_invalid_variable_identifier_characters, '_')
.replace(regex_may_starts_or_ends_with_underscore, "$1") .replace(regex_may_starts_or_ends_with_underscore, '$1')
.replace(regex_starts_with_digit, "_$1"); .replace(regex_starts_with_digit, '_$1');
if (!base) { if (!base) {
throw new Error(`Could not derive component name from file ${filename}`); throw new Error(`Could not derive component name from file ${filename}`);

Loading…
Cancel
Save