@@ -227,25 +227,6 @@ export function convertValue<T extends RelTypedValue>(
227
227
Math . pow ( 10 , typeDef . places ) ,
228
228
) ;
229
229
}
230
- case 'Rational8' :
231
- case 'Rational16' :
232
- case 'Rational32' :
233
- case 'Rational64' : {
234
- value = Array . from ( value ) ;
235
-
236
- return {
237
- numerator : value [ 0 ] ,
238
- denominator : value [ 1 ] ,
239
- } ;
240
- }
241
- case 'Rational128' : {
242
- value = Array . from ( value ) ;
243
-
244
- return {
245
- numerator : int128ToBigInt ( Array . from ( value [ 0 ] ) ) ,
246
- denominator : int128ToBigInt ( Array . from ( value [ 1 ] ) ) ,
247
- } ;
248
- }
249
230
case 'Constant' : {
250
231
return typeDef . value . value ;
251
232
}
@@ -357,12 +338,6 @@ export function getDisplayValue(
357
338
case 'Decimal64' :
358
339
case 'Decimal128' :
359
340
return val . value . toFixed ( val . places ) ;
360
- case 'Rational8' :
361
- case 'Rational16' :
362
- case 'Rational32' :
363
- case 'Rational64' :
364
- case 'Rational128' :
365
- return `${ val . value . numerator } /${ val . value . denominator } ` ;
366
341
case 'ValueType' : {
367
342
const displayValue = val . typeDefs
368
343
. map ( ( td , index ) => {
@@ -536,47 +511,6 @@ function mapValueType(typeDef: Omit<ValueTypeValue, 'value'>): RelTypeDef {
536
511
}
537
512
break ;
538
513
}
539
- case 'Rational' : {
540
- // TODO remove later, this's legacy Rational representation
541
- if ( typeDef . typeDefs . length === 5 && typeDef . typeDefs [ 3 ] ) {
542
- const tp = typeDef . typeDefs [ 3 ] ;
543
-
544
- switch ( tp . type ) {
545
- case 'Int8' :
546
- return { type : 'Rational8' } ;
547
- case 'Int16' :
548
- return { type : 'Rational16' } ;
549
- case 'Int32' :
550
- return { type : 'Rational32' } ;
551
- case 'Int64' :
552
- return { type : 'Rational64' } ;
553
- case 'Int128' :
554
- return { type : 'Rational128' } ;
555
- }
556
- }
557
-
558
- if (
559
- typeDef . typeDefs . length === 6 &&
560
- typeDef . typeDefs [ 3 ] &&
561
- typeDef . typeDefs [ 3 ] . type === 'Constant' &&
562
- typeDef . typeDefs [ 3 ] . value . type === 'Int64'
563
- ) {
564
- const bits = typeDef . typeDefs [ 3 ] . value . value ;
565
-
566
- switch ( bits ) {
567
- case 8n :
568
- return { type : 'Rational8' } ;
569
- case 16n :
570
- return { type : 'Rational16' } ;
571
- case 32n :
572
- return { type : 'Rational32' } ;
573
- case 64n :
574
- return { type : 'Rational64' } ;
575
- case 128n :
576
- return { type : 'Rational128' } ;
577
- }
578
- }
579
- }
580
514
}
581
515
582
516
return typeDef ;
@@ -601,11 +535,6 @@ function unflattenConstantValue(typeDef: RelTypeDef, value: PrimitiveValue[]) {
601
535
case 'Missing' :
602
536
result . push ( null ) ;
603
537
break ;
604
- case 'Rational8' :
605
- case 'Rational16' :
606
- case 'Rational32' :
607
- case 'Rational64' :
608
- case 'Rational128' :
609
538
case 'SHA1' :
610
539
// These types take 2 values
611
540
result . push ( values . splice ( 0 , 2 ) ) ;
0 commit comments