export type Metadata = any; export class Test { constructor(public readonly name: string, public readonly line: number, public readonly values : ReadonlyMap >, public readonly meta : ReadonlyMap >) { } public toJSON(): any { const values: { [key: string]: ReadonlyArray } = {}; this.values.forEach((value, key) => { values[key] = value; }); const meta: { [key: string]: ReadonlyArray } = {}; this.meta.forEach((mvalue, key) => { meta[key] = mvalue; }); return { line: this.line, meta, name: this.name, values, }; } }