@@ -227,25 +227,6 @@ export function convertValue<T extends RelTypedValue>(
227227 Math . pow ( 10 , typeDef . places ) ,
228228 ) ;
229229 }
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- }
249230 case 'Constant' : {
250231 return typeDef . value . value ;
251232 }
@@ -357,12 +338,6 @@ export function getDisplayValue(
357338 case 'Decimal64' :
358339 case 'Decimal128' :
359340 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 } ` ;
366341 case 'ValueType' : {
367342 const displayValue = val . typeDefs
368343 . map ( ( td , index ) => {
@@ -536,47 +511,6 @@ function mapValueType(typeDef: Omit<ValueTypeValue, 'value'>): RelTypeDef {
536511 }
537512 break ;
538513 }
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- }
580514 }
581515
582516 return typeDef ;
@@ -601,11 +535,6 @@ function unflattenConstantValue(typeDef: RelTypeDef, value: PrimitiveValue[]) {
601535 case 'Missing' :
602536 result . push ( null ) ;
603537 break ;
604- case 'Rational8' :
605- case 'Rational16' :
606- case 'Rational32' :
607- case 'Rational64' :
608- case 'Rational128' :
609538 case 'SHA1' :
610539 // These types take 2 values
611540 result . push ( values . splice ( 0 , 2 ) ) ;
0 commit comments