mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-23 09:40:00 +00:00
Wrap types in namespace for --ts-flat-files and --gen-all (#7451)
* Wrap types in namespace for --ts-flat-files and --gen-all * Fixes for escaping object types * Added to generate_code
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
import { Monster as MyGameExample2Monster } from '../../my-game/example2/monster';
|
||||
import { Monster as MyGame_Example2_Monster } from '../../my-game/example2/monster';
|
||||
import { Monster } from '../../my-game/example/monster';
|
||||
import { TestSimpleTableWithEnum } from '../../my-game/example/test-simple-table-with-enum';
|
||||
export var Any;
|
||||
@@ -14,7 +14,7 @@ export function unionToAny(type, accessor) {
|
||||
case 'NONE': return null;
|
||||
case 'Monster': return accessor(new Monster());
|
||||
case 'TestSimpleTableWithEnum': return accessor(new TestSimpleTableWithEnum());
|
||||
case 'MyGame_Example2_Monster': return accessor(new MyGameExample2Monster());
|
||||
case 'MyGame_Example2_Monster': return accessor(new MyGame_Example2_Monster());
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ export function unionListToAny(type, accessor, index) {
|
||||
case 'NONE': return null;
|
||||
case 'Monster': return accessor(index, new Monster());
|
||||
case 'TestSimpleTableWithEnum': return accessor(index, new TestSimpleTableWithEnum());
|
||||
case 'MyGame_Example2_Monster': return accessor(index, new MyGameExample2Monster());
|
||||
case 'MyGame_Example2_Monster': return accessor(index, new MyGame_Example2_Monster());
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user