From e637d5455e33ae05015d4408e538f9bf943be747 Mon Sep 17 00:00:00 2001 From: hrmny Date: Wed, 7 Jun 2023 19:56:08 +0200 Subject: [PATCH] add comment --- crates/turbopack-node/src/debug.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/turbopack-node/src/debug.rs b/crates/turbopack-node/src/debug.rs index f06ed299602ef5..248e722f111736 100644 --- a/crates/turbopack-node/src/debug.rs +++ b/crates/turbopack-node/src/debug.rs @@ -2,6 +2,11 @@ use std::env; const DEBUG_JS_VAR: &str = "TURBOPACK_DEBUG_JS"; +/// Checks if the operation passed is included in the `TURBOPACK_DEBUG_JS` env +/// var to enable node.js debugging at runtime. +/// +/// This is preferable to manually passing a boolean because recompiling won't +/// be necessary. pub fn should_debug(operation: &str) -> bool { let Ok(val) = env::var(DEBUG_JS_VAR) else { return false;