• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// automatically generated by the FlatBuffers compiler, do not modify
2
3import { TableInNestedNS, TableInNestedNST } from '../../namespace-a/namespace-b/table-in-nested-n-s';
4
5
6export enum UnionInNestedNS{
7  NONE = 0,
8  TableInNestedNS = 1
9}
10
11export function unionToUnionInNestedNS(
12  type: UnionInNestedNS,
13  accessor: (obj:TableInNestedNS) => TableInNestedNS|null
14): TableInNestedNS|null {
15  switch(UnionInNestedNS[type]) {
16    case 'NONE': return null;
17    case 'TableInNestedNS': return accessor(new TableInNestedNS())! as TableInNestedNS;
18    default: return null;
19  }
20}
21
22export function unionListToUnionInNestedNS(
23  type: UnionInNestedNS,
24  accessor: (index: number, obj:TableInNestedNS) => TableInNestedNS|null,
25  index: number
26): TableInNestedNS|null {
27  switch(UnionInNestedNS[type]) {
28    case 'NONE': return null;
29    case 'TableInNestedNS': return accessor(index, new TableInNestedNS())! as TableInNestedNS;
30    default: return null;
31  }
32}
33
34