UNPKG

nightscout

Version:

Nightscout acts as a web-based CGM (Continuous Glucose Monitor) to allow multiple caregivers to remotely view a patients glucose data in realtime.

29 lines (20 loc) 545 B
'use strict'; /** * Check the string for strictly valid number (no other characters present) * @param {any} str */ function isNumberInString (str) { return !isNaN(parseFloat(str)) && isFinite(str); } /** * Check the string for non-whitespace characters presence * @param {any} input */ function isNullOrWhitespace (input) { if (typeof input === 'undefined' || input == null) return true; return input.replace(/\s/g, '').length < 1; } module.exports = { isNumberInString, isNullOrWhitespace };