chore(backend): Aanpassingen Dwengo Learning-Object-Repository
Processing uit Dwengo Learning-Object-Repository geconverteerd naar TypeScript en aangepast aan onze app. Functionaliteit van Dwengo Learning-Object-Repository in ons project gekopiëerd en deels aanBestanden die enkel types of interfaces exporteren hernoemd naar *.d.tsgepast aan TypeScript en ons project.
This commit is contained in:
		
							parent
							
								
									ba3da01d2d
								
							
						
					
					
						commit
						463c8c9fc0
					
				
					 45 changed files with 1258 additions and 3747 deletions
				
			
		
							
								
								
									
										18
									
								
								backend/src/util/links.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								backend/src/util/links.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| import {LearningObjectIdentifier} from "../interfaces/learning-content"; | ||||
| 
 | ||||
| export function isValidHttpUrl(url: string): boolean { | ||||
|     try { | ||||
|         const parsedUrl = new URL(url); | ||||
|         return parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:"; | ||||
|     } catch (e) { | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| export function getUrlStringForLearningObject(learningObjectIdentifier: LearningObjectIdentifier): string { | ||||
|     let url = `/learningObject/${learningObjectIdentifier.hruid}/html?language=${learningObjectIdentifier.language}`; | ||||
|     if (learningObjectIdentifier.version) { | ||||
|         url += `&version=${learningObjectIdentifier.version}`; | ||||
|     } | ||||
|     return url; | ||||
| } | ||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger