const DEFAULT_VERSION = '4.22' ; const NEXT = 'next' ; export function parseVersion ( version ) { if ( version . toLowerCase ( ) === NEXT ) { return NEXT ; } const match = version && version . match ( /^(\d)\.(\d+)/ ) ; return match && { major : parseInt ( match [ 1 ] , 10 ) , minor : parseInt ( match [ 2 ] , 10 ) } ; } param version export function getCdnUrl ( version = DEFAULT_VERSION ) { return `https://js.arcgis.com/${ version }/` ; } param version export function getCdnCssUrl ( version = DEFAULT_VERSION ) { const baseUrl = getCdnUrl ( version ) ; const parsedVersion = parseVersion ( version ) ; if ( parsedVersion !== NEXT && parsedVersion . major === 3 ) { const path = parsedVersion . minor <= 10 ? 'js/' : '' ; return `${ baseUrl }${ path }esri/css/esri.css` ; } else { return `${ baseUrl }esri/themes/light/main.css` ; } }