Repository: swc-project/swc (rust)

Issue:
Get value from enum by key
### Describe the bug

Hello, i am migrating a project from ts and found this behavior. Can't dynamically get value by key in enum like in ts. Perhaps I need other settings?

### Input code

```typescript
enum Status {
  "foo" = '111',
  "boo" = "222"
}

const name = "foo"
const text = Status[name] 

console.log(text); // log: foo
```


### Config

```json
{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": false
    },
    "target": "es2015",
    "loose": false,
    "minify": {
      "compress": false,
      "mangle": false
    }
  },
  "module": {
    "type": "es6"
  },
  "minify": false,
  "isModule": true
}
```


### Playground link

https://play.swc.rs/?version=1.2.133&code=H4sIAAAAAAAAA0vNK81VCC5JLCktVqjmUlBQSsvPV1KwVVA3NDRU1wEJJEEElIyMjJS4arm4kvPziksU8hJzU0GiIOVQoZLUihKgEMSwaJCCWAWI8vycVL2c%2FHQNkApNay4A1L6k%2FXQAAAA%3D&config=H4sIAAAAAAAAA0WNSwrDMAxE76J1Fm2hXeQOPYRxleDgHxoFGozvXju4ZCfNPD0V2mBpLpSNgKVPOKKaL82kR2ZYcVlpIkWLFuPBtS1GVtaGMB63%2B7PVPiXwACYKLrrl6DKbQhYGrsrE1f%2FJ2lwhffYelPPf6XxRvRzjzuE9QJWd6w%2ByirtzuAAAAA%3D%3D

### Expected behavior

Logging string:  "111"

### Actual behavior

Logging string : "foo"

### Version

1.2.133

### Additional context

Output

```javascript
var Status;
(function(Status) {
    Status["foo"] = "foo"; // not my value by key, waited Status["foo"] =  '111'
    Status["boo"] = "boo"; // not my value by key, waited Status["boo"] =  '222'
})(Status || (Status = {}));
const name = "foo";
const text = Status[name];
console.log(text); // log: 111
```


Pull request description:
fix(es/typescript): value with enum string prop
**Description:**

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

**BREAKING CHANGE:**
<!--
If this PR introduces a breaking change, it must contain a notice for it to be included in the CHANGELOG. Add description or remove entirely if not breaking.

You may need to update `MIGRATION.md` for the breaking changes.
-->

**Related issue (if exists):**
- fix #3338 

Patch:
diff --git a/crates/swc_ecma_transforms_typescript/src/strip.rs b/crates/swc_ecma_transforms_typescript/src/strip.rs
index 42ab4e2dea..b042abf87f 100644
--- a/crates/swc_ecma_transforms_typescript/src/strip.rs
+++ b/crates/swc_ecma_transforms_typescript/src/strip.rs
@@ -991,7 +991,7 @@ where
         let rhs_should_be_name = members.iter().all(|(m, v): &(TsEnumMember, Expr)| match v {
             Expr::Lit(Lit::Str(s)) => match &m.id {
                 TsEnumMemberId::Ident(i) => i.sym == s.value,
-                TsEnumMemberId::Str(s2) => s2.value != s.value,
+                TsEnumMemberId::Str(s2) => s2.value == s.value,
             },
             _ => true,
         });


Test patch:
diff --git a/crates/swc_ecma_transforms_typescript/tests/fixture/issue-3338/1/input.ts b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-3338/1/input.ts
new file mode 100644
index 0000000000..d530b3e6b5
--- /dev/null
+++ b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-3338/1/input.ts
@@ -0,0 +1,4 @@
+enum Status {
+    "foo" = "111",
+    "boo" = "222",
+}
diff --git a/crates/swc_ecma_transforms_typescript/tests/fixture/issue-3338/1/output.js b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-3338/1/output.js
new file mode 100644
index 0000000000..22bd2e9c0d
--- /dev/null
+++ b/crates/swc_ecma_transforms_typescript/tests/fixture/issue-3338/1/output.js
@@ -0,0 +1,5 @@
+var Status;
+(function (Status) {
+    Status["foo"] = "111";
+    Status["boo"] = "222";
+})(Status || (Status = {}));