From 408325daa67dc20bc6a09c122a3f2690e83a2dea Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 30 Sep 2024 13:18:18 -0700 Subject: [PATCH] refactor: make magic number a const --- example/faultManagement/utils.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example/faultManagement/utils.js b/example/faultManagement/utils.js index 536c1e3a741..16614d8ad54 100644 --- a/example/faultManagement/utils.js +++ b/example/faultManagement/utils.js @@ -21,6 +21,7 @@ *****************************************************************************/ const SEVERITIES = ['WATCH', 'WARNING', 'CRITICAL']; +const MOONWALK_TIMESTAMP = 14159040000; const NAMESPACE = '/Example/fault-'; const getRandom = { severity: () => SEVERITIES[Math.floor(Math.random() * 3)], @@ -36,7 +37,7 @@ const getRandom = { val = num; severity = SEVERITIES[severityIndex - 1]; // Subtract `num` from the timestamp so that the faults are in order - time = 14159040000 - num; // Mon, 21 Jul 1969 02:56:00 GMT 🌔👨‍🚀👨‍🚀👨‍🚀 + time = MOONWALK_TIMESTAMP - num; // Mon, 21 Jul 1969 02:56:00 GMT 🌔👨‍🚀👨‍🚀👨‍🚀 } return {