timocov / ts-transformer-properties-rename

TypeScript custom transformer to rename properties

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enums are not renamed causing runtime error

87vrvk9k opened this issue · comments

Enum members are not renamed, but member access is renamed resulting in potential runtime errors.

export enum TestEnum {
  Test1,
  Test2,
  Test3,
}

Results in:

export var TestEnum;
(function (TestEnum) {
    TestEnum[TestEnum["Test1"] = 0] = "Test1";
    TestEnum[TestEnum["Test2"] = 1] = "Test2";
    TestEnum[TestEnum["Test3"] = 2] = "Test3";
})(TestEnum || (TestEnum = {}));

Member access results in:

console.log(TestEnum._internal_Test1);

Which does not exist.