import { ODataVersion } from '@sap-cloud-sdk/util' ; export function getGenericTypesWithDefault ( oDataVersion ) { return getGenericTypeAndDefault ( oDataVersion ) . map ( typeAndDefault => `${ typeAndDefault [ 0 ] } = ${ typeAndDefault [ 1 ] }` ) . join ( ',\n' ) ; } export function getGenericTypes ( oDataVersion ) { return getGenericTypeAndDefault ( oDataVersion ) . map ( typeAndDefault => typeAndDefault [ 0 ] ) . join ( ',\n' ) ; } function getGenericTypeAndDefault ( oDataVersion ) { const nonCommonGenericTypeAndDefault = oDataVersion === 'v4' ? [ [ 'DateT' , 'Moment' ] , [ 'DurationT' , 'Duration' ] , [ 'TimeOfDayT' , 'Time' ] ] : [ [ 'DateTimeT' , 'Moment' ] , [ 'TimeT' , 'Time' ] ] ; return [ ... commonGenericTypeAndDefault , ... nonCommonGenericTypeAndDefault ] ; } const commonGenericTypeAndDefault = [ [ 'BinaryT' , 'string' ] , [ 'BooleanT' , 'boolean' ] , [ 'ByteT' , 'number' ] , [ 'DecimalT' , 'BigNumber' ] , [ 'DoubleT' , 'number' ] , [ 'FloatT' , 'number' ] , [ 'Int16T' , 'number' ] , [ 'Int32T' , 'number' ] , [ 'Int64T' , 'BigNumber' ] , [ 'GuidT' , 'string' ] , [ 'SByteT' , 'number' ] , [ 'SingleT' , 'number' ] , [ 'StringT' , 'string' ] , [ 'AnyT' , 'any' ] , [ 'DateTimeOffsetT' , 'Moment' ] ] ;