Skip to main content

Function: rowToMonitorOrUndefined()

rowToMonitorOrUndefined(row: undefined | MonitorRow): undefined | Monitor

Defined in: electron/services/database/utils/monitorMapper.ts:362

Converts a database row to a monitor object, or returns undefined if the row is missing.

Parameters

row

The raw database row or undefined.

undefined | MonitorRow

Returns

undefined | Monitor

The mapped monitor object, or undefined if the row is missing.

Remarks

  • Returns undefined if the input row is undefined or null.
  • Otherwise, delegates to rowToMonitor.
  • Used by repository methods where a missing monitor is not an error.

Example

const monitor = rowToMonitorOrUndefined(dbRowOrUndefined);

Throws

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global\_Objects/Error if mapping fails for a valid row.

See

rowToMonitor