From be43b854cede111e06da62ac3229227ce67c51ba Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Mon, 3 Aug 2020 20:16:04 +0200 Subject: [PATCH] workaround for rega nan values (#2, https://github.com/rdmtc/RedMatic/issues/381) --- index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js b/index.js index c565180..cf0e855 100644 --- a/index.js +++ b/index.js @@ -140,6 +140,8 @@ class Rega { if (err) { callback(err); } else { + // Todo: remove ugly workaround for https://github.com/rdmtc/RedMatic/issues/381 + res = res.replace(/, "val": nan,/g, ', "val": null,'); try { callback(null, JSON.parse(res)); } catch (_) {