transpiler: normalize Dart library name
`file2module` was used for normalizing paths where `-` is fine. This normalizes non-word characters only when generating the Dart library name.
This commit is contained in:
@ -20,7 +20,7 @@ import {ParseTreeWriter as JavaScriptParseTreeWriter, ObjectLiteralExpression} f
|
||||
export class DartParseTreeWriter extends JavaScriptParseTreeWriter {
|
||||
constructor(moduleName, outputPath) {
|
||||
super(outputPath);
|
||||
this.libName = moduleName.replace(/\//g, '.');
|
||||
this.libName = moduleName.replace(/\//g, '.').replace(/[^\w.\/]/g, '_');
|
||||
}
|
||||
|
||||
// VARIABLES - types
|
||||
|
Reference in New Issue
Block a user