Skip to content

Commit 32a41cf

Browse files
committed
fix(napi/minify): s/passes/max_iterations to avoid confusion (#14608)
`max_iterations` does not behave like `passes`, and may change in the future. It should only be used for debugging purposes, as said on the comment.
1 parent a3502ee commit 32a41cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

napi/minify/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface CompressOptions {
6161
*/
6262
sequences?: boolean
6363
/** Limit the maximum number of iterations for debugging purpose. */
64-
passes?: number
64+
maxIterations?: number
6565
}
6666

6767
export interface CompressOptionsKeepNames {

napi/minify/src/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub struct CompressOptions {
5353
pub sequences: Option<bool>,
5454

5555
/// Limit the maximum number of iterations for debugging purpose.
56-
pub passes: Option<u8>,
56+
pub max_iterations: Option<u8>,
5757
}
5858

5959
impl TryFrom<&CompressOptions> for oxc_minifier::CompressOptions {
@@ -81,7 +81,7 @@ impl TryFrom<&CompressOptions> for oxc_minifier::CompressOptions {
8181
},
8282
keep_names: o.keep_names.as_ref().map(Into::into).unwrap_or_default(),
8383
treeshake: TreeShakeOptions::default(),
84-
max_iterations: o.passes,
84+
max_iterations: o.max_iterations,
8585
})
8686
}
8787
}

0 commit comments

Comments
 (0)