Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/builder/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export class MapBuilder<K extends DataType = any, V extends DataType = any, TNul
}

public setValue(index: number, value: MapValueExt<K, V>) {
const row = (value instanceof Map ? value : new Map(Object.entries(value))) as MapValue<K, V>;
const row = (value instanceof Map ? value : new Map(Object.entries(value))) as unknown as MapValue<K, V>;
const pending = this._pending || (this._pending = new Map() as MapValues<K, V>);
const current = pending.get(index) as Map<K, V> | undefined;
const current = pending.get(index);
current && (this._pendingLength -= current.size);
this._pendingLength += row.size;
pending.set(index, row);
Expand Down
3 changes: 2 additions & 1 deletion src/row/struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export class StructRow<T extends TypeMap = any> {
const keys = parent.type.children;
const json = {} as { [P in string & keyof T]: T[P]['TValue'] };
for (let j = -1, n = keys.length; ++j < n;) {
json[keys[j].name as string & keyof T] = getVisitor.visit(parent.children[j], i);
const fieldName = keys[j].name as string & keyof T;
json[fieldName] = getVisitor.visit(parent.children[j], i);
}
return json;
}
Expand Down