File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ const example = {
71
71
string_number : '1234' ,
72
72
timer : 0 ,
73
73
avatar,
74
- date : new Date ( 'Tue Sep 13 2022 14:07:44 GMT-0500 (Central Daylight Time)' )
74
+ date : new Date ( 'Tue Sep 13 2022 14:07:44 GMT-0500 (Central Daylight Time)' ) ,
75
+ bigint : 123456789087654321n
75
76
}
76
77
77
78
const KeyRenderer : JsonViewerKeyRenderer = ( { path } ) => {
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export function createEasyType<Value> (
46
46
store => store . colorspace [ config . colorKey ] )
47
47
return (
48
48
< InputBase
49
- value = { value }
49
+ value = { ` ${ value } ` }
50
50
onChange = {
51
51
useCallback < React . ChangeEventHandler < HTMLTextAreaElement | HTMLInputElement > > (
52
52
( event ) => {
Original file line number Diff line number Diff line change @@ -242,3 +242,17 @@ registerType<number>(
242
242
)
243
243
}
244
244
)
245
+
246
+ registerType < bigint > (
247
+ {
248
+ is : ( value ) : value is bigint => typeof value === 'bigint' ,
249
+ ...createEasyType (
250
+ 'bigint' ,
251
+ ( { value } ) => < > { `${ value } n` } </ > ,
252
+ {
253
+ colorKey : 'base0F' ,
254
+ fromString : value => BigInt ( value . replace ( / \D / g, '' ) )
255
+ }
256
+ )
257
+ }
258
+ )
You can’t perform that action at this time.
0 commit comments