Download next.js/turbopack/crates/turbopack-node/src/debug.rs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 610 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-node/src/debug.rs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/turbopack/crates/turbopack-node/src/debug.rs
-
curl -L -o debug.rs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-node/src/debug.rs
610 Bytes
| 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 { | |
| // TODO(sokra) It's not persistent caching safe to read an env var this way. | |
| // This must use turbo_tasks_env instead. | |
| let Ok(val) = env::var(DEBUG_JS_VAR) else { | |
| return false; | |
| }; | |
| val == "*" || val.split(',').any(|part| part == operation) | |
| } | |