Skip to content

Commit

Permalink
🦄 refactor: Remove getRawString() from ast str
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed May 17, 2024
1 parent f5c8785 commit 520005d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 2 additions & 0 deletions docs/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## 0.8.0

* Added `replaceNode()` to `ISwc4jAst`
* Added coercion to primitive AST types
* Added experimental JsFuck decoder

## 0.7.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,6 @@ public Optional<String> getRaw() {
return raw;
}

public String getRawString() {
return raw.orElse(value);
}

@Override
public Swc4jAstType getType() {
return Swc4jAstType.Str;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ protected void assertSpan(String code, ISwc4jAst node) {
case TsKeywordType:
text = node.toString();
break;
case Str:
text = node.as(Swc4jAstStr.class).getRawString();
case Str: {
Swc4jAstStr str = node.as(Swc4jAstStr.class);
text = str.getRaw().orElse(str.getValue());
break;
}
default:
break;
}
Expand Down

0 comments on commit 520005d

Please sign in to comment.