Skip to content

Commit 5a968c8

Browse files
author
Cédric Belin
committed
The TransformMode enumeration is now implemented as a frozen object
1 parent 47b02a3 commit 5a968c8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/gulp_plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export interface GulpPluginOptions {
7171
/**
7272
* The operation mode of the plugin.
7373
*/
74-
mode: TransformMode|"fast"|"safe";
74+
mode: TransformMode;
7575

7676
/**
7777
* Value indicating whether to silence the plugin output.

src/transform_mode.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
/**
22
* The operation mode of the minifier.
33
*/
4-
export enum TransformMode {
4+
export const TransformMode = Object.freeze({
55

66
/**
77
* Applies a fast transformation.
88
*/
9-
fast = "fast",
9+
fast: "fast",
1010

1111
/**
1212
* Applies a safe transformation.
1313
*/
14-
safe = "safe"
15-
}
14+
safe: "safe"
15+
});
16+
17+
/**
18+
* The operation mode of the minifier.
19+
*/
20+
export type TransformMode = typeof TransformMode[keyof typeof TransformMode];

0 commit comments

Comments
 (0)