UNPKG

ravendb

Version:
33 lines 1.09 kB
import { throwError } from "../../../Exceptions/index.js"; import { TypedTimeSeriesEntry } from "./TypedTimeSeriesEntry.js"; import { TimeSeriesValuesHelper } from "./TimeSeriesValuesHelper.js"; export class TimeSeriesEntry { timestamp; tag; values; isRollup; nodeValues; get value() { if (this.values.length === 1) { return this.values[0]; } throwError("InvalidOperationException", "Entry has more than one value."); } set value(value) { if (this.values.length === 1) { this.values[0] = value; return; } throwError("InvalidOperationException", "Entry has more than one value."); } asTypedEntry(clazz) { const entry = new TypedTimeSeriesEntry(); entry.isRollup = this.isRollup; entry.tag = this.tag; entry.timestamp = this.timestamp; entry.values = this.values; entry.value = TimeSeriesValuesHelper.setFields(clazz, this.values, this.isRollup); return entry; } } //# sourceMappingURL=TimeSeriesEntry.js.map