mirror of
https://github.com/meld-cp/obsidian-build.git
synced 2026-07-22 07:30:25 +00:00
30 lines
555 B
TypeScript
30 lines
555 B
TypeScript
export class DataSet extends Array<DataSetRow> {
|
|
|
|
}
|
|
|
|
export interface IDataSetCollection {
|
|
[name:string] : DataSet;
|
|
}
|
|
|
|
interface IRowDataValueCollection {
|
|
[column:string | number] : unknown
|
|
}
|
|
|
|
export class DataSetRow implements IRowDataValueCollection{
|
|
|
|
[column: string]: unknown;
|
|
|
|
constructor(columnNames:string[], data: unknown[]){
|
|
for (let colIdx = 0; colIdx < columnNames.length; colIdx++) {
|
|
const value = data.at(colIdx);
|
|
const colName = columnNames[colIdx].trim();
|
|
if ( colName != '' ){
|
|
this[colName] = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|