Skip to content

Commit 4a34247

Browse files
committed
export Row type
1 parent 141194e commit 4a34247

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

js/src/types/table/row.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export class RowVector<T = any> extends Vector<T> implements Row<T> {
4848
}
4949
toArray() { return [...this]; }
5050
toJSON() { return this.toArray(); }
51-
toString() { return `Row [${this.length})` }
52-
toObject(): Record<string, any> {
51+
toString() { return `Row [${this.length})`; }
52+
toObject(): Record<string, T> {
5353
const { row } = this, map = Object.create(null);
5454
for (const col of this.table.columns) {
5555
if (col && col.name) {

js/src/types/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ export interface Vector<T = any> extends Iterable<T | null> {
5555

5656
export interface Row<T = any> extends Vector<T> {
5757
col(key: string): T | null;
58+
toArray(): Array<T>;
59+
toObject(): Record<string, T>;
5860
}
5961

6062
export interface Column<T = any> extends Vector<T> {

js/test/Arrow.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ else modulePath = path.join(target, format);
4040
let Arrow: any = require(path.resolve(`./targets`, modulePath, `Arrow`));
4141

4242
import {
43+
Row as Row_,
4344
Table as Table_,
4445
Vector as Vector_,
4546
readBuffers as readBuffers_,
@@ -64,6 +65,7 @@ import {
6465
FixedSizeListVector as FixedSizeListVector_,
6566
} from '../src/Arrow';
6667

68+
export let Row = Arrow.Row as typeof Row_;
6769
export let Table = Arrow.Table as typeof Table_;
6870
export let Vector = Arrow.Vector as typeof Vector_;
6971
export let readBuffers = Arrow.readBuffers as typeof readBuffers_;

0 commit comments

Comments
 (0)