use napi_derive::napi; // Aligned with Rollup's sourcemap input. // // // // ``` // export interface ExistingRawSourceMap { // file?: string; // mappings: string; // names: string[]; // sourceRoot?: string; // sources: string[]; // sourcesContent?: string[]; // version: number; // x_google_ignoreList?: number[]; // } // ``` #[napi(object)] pub struct SourceMap { pub file: Option, pub mappings: Option, pub names: Option>, pub source_root: Option, pub sources: Option>>, pub sources_content: Option>>, pub version: u8, #[napi(js_name = "x_google_ignoreList")] pub x_google_ignorelist: Option>, } impl From for SourceMap { fn from(source_map: oxc_sourcemap::SourceMap) -> Self { let json = source_map.to_json(); Self { file: json.file, mappings: json.mappings, names: json.names, source_root: json.source_root, sources: json.sources, sources_content: json.sources_content, version: 3, x_google_ignorelist: None, } } }