next_core/
instrumentation.rs

1use anyhow::Result;
2use turbo_rcstr::RcStr;
3use turbo_tasks::Vc;
4
5#[turbo_tasks::function]
6pub async fn instrumentation_files(page_extensions: Vc<Vec<RcStr>>) -> Result<Vc<Vec<RcStr>>> {
7    let extensions = page_extensions.await?;
8    let files = ["instrumentation.", "src/instrumentation."]
9        .into_iter()
10        .flat_map(|f| {
11            extensions
12                .iter()
13                .map(move |ext| String::from(f) + ext.as_str())
14                .map(RcStr::from)
15        })
16        .collect();
17    Ok(Vc::cell(files))
18}