export async function compile ( urlTemplate , context , doEncode = true ) { const handlebarsTemplate = ( await import ( './handlebars' ) . then ( ( m ) => m . handlebars ) ) . compile ( urlTemplate , { strict : true , noEscape : true , } ) ; let processedUrl = handlebarsTemplate ( context ) ; if ( doEncode ) { processedUrl = encodeURI ( processedUrl ) ; } return processedUrl ; }