eject-enum
    Preparing search index...

    Type Alias EjectEnumOptions

    Additional options for the rewrite.

    type EjectEnumOptions = {
        preserveExpr?: boolean;
        silent?: boolean;
    }
    Index

    Properties

    preserveExpr?: boolean

    If true, the expression of each enum member's initializer is preserved as trailing comment if the expression is not a literal.

    For example:

    // original
    enum E {
    X = (1 + 2) * (3 + 4)
    }
    // ejected
    const E = {
    X: 21 // (1 + 2) * (3 + 4)
    } as const;

    type E = // snip

    true

    silent?: boolean

    If true, all outputs are suppressed.

    false