Download next.js/turbopack/crates/turbopack-ecmascript/src/chunk/data.rs from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-ecmascript/src/chunk/data.rs
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/turbopack/crates/turbopack-ecmascript/src/chunk/data.rs
-
curl -L -o data.rs https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/turbopack/crates/turbopack-ecmascript/src/chunk/data.rs
1.2 kB
| use serde::Serialize; | |
| use turbo_tasks::ReadRef; | |
| use turbopack_core::chunk::{ChunkData, ModuleId}; | |
| pub enum EcmascriptChunkData<'a> { | |
| Simple(&'a str), | |
| WithRuntimeInfo { | |
| path: &'a str, | |
| included: &'a [ReadRef<ModuleId>], | |
| excluded: &'a [ReadRef<ModuleId>], | |
| module_chunks: &'a [String], | |
| }, | |
| } | |
| impl EcmascriptChunkData<'_> { | |
| pub fn new(chunk_data: &ChunkData) -> EcmascriptChunkData<'_> { | |
| let ChunkData { | |
| path, | |
| included, | |
| excluded, | |
| module_chunks, | |
| references: _, | |
| } = chunk_data; | |
| if included.is_empty() && excluded.is_empty() && module_chunks.is_empty() { | |
| return EcmascriptChunkData::Simple(path); | |
| } | |
| EcmascriptChunkData::WithRuntimeInfo { | |
| path, | |
| included, | |
| excluded, | |
| module_chunks, | |
| } | |
| } | |
| } | |