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