@welldot/utils

buildLoggerReadings

Turns imported rows into logger readings using a column mapping.

buildLoggerReadings(rows, mapping): object

Turns imported rows into logger readings using a column mapping.

The first headerRows rows are skipped. Timestamps that carry an offset keep it; otherwise timeZone (resolved with localDateTimeToInstant) and then offset apply, in that order. Decimal commas are accepted. With valueKind: 'water_column' the depth is sensorDepth − value, rounded to 3 decimals. A date without a time reads as 00:00.

Parameters

rows

string[]

Rows from parseDelimitedText.

mapping

LoggerImportMapping

Column mapping and conventions.

Returns

object

The readings and the skipped rows with their zero-based index in rows (header rows included) and the reason.

readings

readings: LoggerReading

skipped

skipped: object