@welldot/utils
mergeLoggerReadings
Merges imported readings into a series.
mergeLoggerReadings(
existing,incoming,mode):object
Merges imported readings into a series.
Instants compare as instants, so 2026-07-01T03:00:00Z equals
2026-07-01T00:00:00-03:00. In append mode the incoming reading wins on an
equal instant; in replace mode only the incoming readings remain. The
result is sorted by instant; within incoming, the last of equal instants wins.
Parameters
existing
LoggerReading
incoming
LoggerReading
mode
"append" | "replace"
Returns
object
The readings and replaced: in append mode, how many existing
readings an incoming one overwrote; in replace mode, how many existing
readings were dropped.
readings
readings:
LoggerReading
replaced
replaced:
number