UNPKG

@rcsb/rcsb-saguaro

Version:
28 lines (27 loc) 743 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RowStatusMap = void 0; class RowStatusMap { constructor() { this.rowReadyMap = new Map(); } set(key, value) { this.rowReadyMap.set(key, value); } size() { return this.rowReadyMap.size; } clear(rowIds) { if (rowIds) rowIds.forEach(id => this.rowReadyMap.delete(id)); else this.rowReadyMap.clear(); } complete() { return Array.from(this.rowReadyMap.values()).filter(a => a).length == this.rowReadyMap.size; } completed() { return Array.from(this.rowReadyMap.values()).filter(a => a).length; } } exports.RowStatusMap = RowStatusMap;