import { EdmTypeShared } from '../edm-types' ; import { DeSerializers } from './de-serializers' ; internal export function isInfOrNan ( value ) { if ( typeof value === 'number' ) { return false ; } return [ 'inf' , '-inf' , 'nan' ] . includes ( value . toLowerCase ( ) ) ; } internal export function convertToUriForEdmString ( value ) { return `'${ value . replace ( /'/g , "''" ) }'` ; } internal export type UriConverter = ( value : any , edmType : EdmTypeShared < 'any' > ) => string ; internal export function createUriConverter ( deSerializers ) { return ( value , edmType ) : string => { const { serializeToUri , serialize } = deSerializers [ edmType ] ; return serializeToUri ? serializeToUri ( value , serialize ) : serialize ( value ) ; } ; }