Combine the two replace statements into one

pull/7664/head
Dane David 4 years ago
parent b169edb5d2
commit 81e418e0fe

@ -15,8 +15,7 @@ export default function get_name_from_filename(filename: string) {
.replace(/%/g, 'u')
.replace(/\.[^.]+$/, '')
.replace(/[^a-zA-Z_$0-9]+/g, '_')
.replace(/^_(?=.)/, '')
.replace(/(?<=.)_$/, '')
.replace(/^_?(.+?)_?$/, '$1')
.replace(/^(\d)/, '_$1');
if (!base) {

Loading…
Cancel
Save