Skip to content

Commit

Permalink
enh(typescript) add satisfies keyword (#4058)
Browse files Browse the repository at this point in the history
  • Loading branch information
kisaragi-hiu committed May 25, 2024
1 parent 5237004 commit 4bbf361
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CAVEATS / POTENTIALLY BREAKING CHANGES

Core Grammars:

- enh(typescript) add support for `satisfies` operator [Kisaragi Hiu][]
- enc(c) added more C23 keywords [Melkor-1][]
- enh(json) added jsonc as an alias [BackupMiles][]
- enh(gml) updated to latest language version (GML v2024.2) [gnysek][]
Expand Down Expand Up @@ -64,6 +65,7 @@ Themes:

- Added `1c-light` theme a like in the IDE 1C:Enterprise 8 (for 1c) [Vitaly Barilko][]

[Kisaragi Hiu]: https://github.com/kisaragi-hiu
[Melkor-1]: https://github.com/Melkor-1
[PeteLomax]: https://github.com/petelomax
[gnysek]: https://github.com/gnysek
Expand Down
3 changes: 2 additions & 1 deletion src/languages/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export default function(hljs) {
"abstract",
"readonly",
"enum",
"override"
"override",
"satisfies"
];

/*
Expand Down
2 changes: 2 additions & 0 deletions test/markup/typescript/satisfies-and-as.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<span class="hljs-keyword">const</span> test3 = <span class="hljs-string">&#x27;test3&#x27;</span> <span class="hljs-keyword">as</span> <span class="hljs-title class_">ValidName</span>
<span class="hljs-keyword">const</span> test4 = <span class="hljs-string">&#x27;test4&#x27;</span> <span class="hljs-keyword">satisfies</span> <span class="hljs-title class_">ValidName</span>
2 changes: 2 additions & 0 deletions test/markup/typescript/satisfies-and-as.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const test3 = 'test3' as ValidName
const test4 = 'test4' satisfies ValidName

0 comments on commit 4bbf361

Please sign in to comment.