refactor(nc-gui): remove file name to adapter

This commit is contained in:
Wing-Kam Wong
2022-10-18 11:28:30 +08:00
parent a25f32f184
commit 1b2a508fbb
3 changed files with 51 additions and 57 deletions

View File

@@ -14,25 +14,22 @@ const extractNestedData: any = (obj: any, path: any) => path.reduce((val: any, k
export default class JSONTemplateAdapter extends TemplateGenerator {
config: Record<string, any>
name: string
data: Record<string, any>
_jsonData: string | Record<string, any>
jsonData: Record<string, any>
project: {
title: string
tables: Record<string, any>[]
}
columns: object
constructor(name = 'test', data: object, parserConfig = {}) {
constructor(data: object, parserConfig = {}) {
super()
this.config = {
maxRowsToParse: 500,
...parserConfig,
}
this.name = name
this._jsonData = data
this.project = {
title: this.name,
tables: [],
}
this.jsonData = []