fixed invalid TS call and added test files (#6495)

e581013e3d broke TS generation - please don't use "replace" to refactor function names :)
This commit is contained in:
Kamil Rojewski
2021-03-04 21:12:44 +01:00
committed by GitHub
parent a083572512
commit 4033ff5892
36 changed files with 4185 additions and 4029 deletions

View File

@@ -0,0 +1,33 @@
// automatically generated by the FlatBuffers compiler, do not modify
import { TableInNestedNS, TableInNestedNST } from '../../namespace-a/namespace-b/table-in-nested-n-s';
export enum UnionInNestedNS{
NONE = 0,
TableInNestedNS = 1
}
export function unionToUnionInNestedNS(
type: UnionInNestedNS,
accessor: (obj:TableInNestedNS) => TableInNestedNS|null
): TableInNestedNS|null {
switch(UnionInNestedNS[type]) {
case 'NONE': return null;
case 'TableInNestedNS': return accessor(new TableInNestedNS())! as TableInNestedNS;
default: return null;
}
}
export function unionListToUnionInNestedNS(
type: UnionInNestedNS,
accessor: (index: number, obj:TableInNestedNS) => TableInNestedNS|null,
index: number
): TableInNestedNS|null {
switch(UnionInNestedNS[type]) {
case 'NONE': return null;
case 'TableInNestedNS': return accessor(index, new TableInNestedNS())! as TableInNestedNS;
default: return null;
}
}