#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
#![warn(unused_must_use)]
pub mod bundle_enums;
pub mod code_coverage_options;
pub mod command_tag;
pub mod compile_target;
pub mod context;
pub mod global_cache;
pub mod jsx;
pub mod offline_mode;
pub mod schema;
pub use jsx as JSX;
pub use bundle_enums::{
BuiltInModule, BundlePackage, ForceNodeEnv, Format, ImportKindExt, LOADER_API_NAMES, LoaderExt,
LoaderOptionalExt, ModuleType, TargetExt, WindowsOptions,
};
pub mod standalone_path {
#[cfg(not(windows))]
pub const BASE_PATH: &str = "/$bunfs/";
#[cfg(windows)]
pub const BASE_PATH: &str = "B:\\~BUN\\";
#[cfg(not(windows))]
pub const BASE_PUBLIC_PATH: &str = "/$bunfs/";
#[cfg(windows)]
pub const BASE_PUBLIC_PATH: &str = "B:/~BUN/";
#[cfg(not(windows))]
pub const BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX: &str =
const_format::concatcp!(BASE_PUBLIC_PATH, "root/");
#[cfg(windows)]
pub const BASE_PUBLIC_PATH_WITH_DEFAULT_SUFFIX: &str =
const_format::concatcp!(BASE_PUBLIC_PATH, "root/");
#[inline]
pub(crate) fn is_bun_standalone_file_path_canonicalized(str_: &[u8]) -> bool {
str_.starts_with(BASE_PATH.as_bytes())
|| (cfg!(windows) && str_.starts_with(BASE_PUBLIC_PATH.as_bytes()))
}
#[inline]
pub fn is_bun_standalone_file_path(str_: &[u8]) -> bool {
#[cfg(windows)]
{
let canonicalized = bun_paths::string_paths::without_nt_prefix::<u8>(str_);
return is_bun_standalone_file_path_canonicalized(canonicalized);
}
#[cfg(not(windows))]
{
is_bun_standalone_file_path_canonicalized(str_)
}
}
}