-
-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(codegen): print readonly keyword for TSIndexSignature
- Loading branch information
Showing
3 changed files
with
16 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export const EMPTY_OBJ: { readonly [key: string]: any } = __DEV__ | ||
? Object.freeze({}) | ||
: {} | ||
export const EMPTY_ARR: readonly never[] = __DEV__ ? Object.freeze([]) : [] |
8 changes: 8 additions & 0 deletions
8
crates/oxc_isolated_declarations/tests/snapshots/readonly.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
source: crates/oxc_isolated_declarations/tests/mod.rs | ||
input_file: crates/oxc_isolated_declarations/tests/fixtures/readonly.ts | ||
--- | ||
==================== .D.TS ==================== | ||
|
||
export declare const EMPTY_OBJ: {readonly [key: string]: any}; | ||
export declare const EMPTY_ARR: readonly (never)[]; |