UNPKG

homebridge-roborock

Version:

Xiaomi Vacuum Cleaner - 1st (Mi Robot), 2nd (Roborock S50 + S55), 3rd Generation (Roborock S6) and S5 Max - plugin for Homebridge.

13 lines (12 loc) 335 B
'use strict'; /** * Calls the function `fn` if `maybeValue` is not undefined * * @param maybeValue The value that can be undefined * @param fn The function to be called with the value as a parameter */ module.exports = async function (maybeValue, fn) { if (typeof maybeValue !== 'undefined') { return fn(maybeValue); } }