mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
This PR correctly handles babel `options.json` such as https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-nullish-coalescing-operator/test/fixtures/assumption-noDocumentAll/options.json
18 lines
459 B
Rust
18 lines
459 B
Rust
use std::path::{Path, PathBuf};
|
|
|
|
mod babel;
|
|
mod request;
|
|
mod test_file;
|
|
|
|
pub use crate::{babel::BabelOptions, request::agent, test_file::*};
|
|
|
|
/// # Panics
|
|
/// Invalid Project Root
|
|
pub fn project_root() -> PathBuf {
|
|
project_root::get_project_root().unwrap()
|
|
}
|
|
|
|
/// Normalizes the path when on Windows to using forward slash delimiters.
|
|
pub fn normalize_path<P: AsRef<Path>>(path: P) -> String {
|
|
path.as_ref().display().to_string().replace('\\', "/")
|
|
}
|