refactor: Arrays

This commit is contained in:
Tibo De Peuter 2025-03-23 13:12:03 +01:00
parent ac10518cb8
commit e1aba11222
Signed by: tdpeuter
GPG key ID: 38297DE43F75FFE2
14 changed files with 29 additions and 23 deletions

View file

@ -2,7 +2,7 @@ import { EntityManager } from '@mikro-orm/core';
import { Attachment } from '../../../src/entities/content/attachment.entity';
import { LearningObject } from '../../../src/entities/content/learning-object.entity';
export function makeTestAttachments(em: EntityManager, learningObjects: Array<LearningObject>): Array<Attachment> {
export function makeTestAttachments(em: EntityManager, learningObjects: LearningObject[]): Attachment[] {
const attachment01 = em.create(Attachment, {
learningObject: learningObjects[1],
name: 'attachment01',

View file

@ -4,7 +4,7 @@ import { Language } from '../../../src/entities/content/language';
import { DwengoContentType } from '../../../src/services/learning-objects/processing/content-type';
import { ReturnValue } from '../../../src/entities/content/return-value.entity';
export function makeTestLearningObjects(em: EntityManager): Array<LearningObject> {
export function makeTestLearningObjects(em: EntityManager): LearningObject[] {
const returnValue: ReturnValue = new ReturnValue();
returnValue.callbackSchema = '';
returnValue.callbackUrl = '';

View file

@ -4,7 +4,7 @@ import { Language } from '../../../src/entities/content/language';
import { LearningPathTransition } from '../../../src/entities/content/learning-path-transition.entity';
import { LearningPathNode } from '../../../src/entities/content/learning-path-node.entity';
export function makeTestLearningPaths(em: EntityManager): Array<LearningPath> {
export function makeTestLearningPaths(em: EntityManager): LearningPath[] {
const learningPathNode01: LearningPathNode = new LearningPathNode();
const learningPathNode02: LearningPathNode = new LearningPathNode();
const learningPathNode03: LearningPathNode = new LearningPathNode();
@ -67,7 +67,7 @@ export function makeTestLearningPaths(em: EntityManager): Array<LearningPath> {
learningPathNode05.transitions = [transitions05];
learningPathNode05.version = 1;
const nodes01: Array<LearningPathNode> = [
const nodes01: LearningPathNode[] = [
// LearningPathNode01,
// LearningPathNode02,
];
@ -81,7 +81,7 @@ export function makeTestLearningPaths(em: EntityManager): Array<LearningPath> {
nodes: nodes01,
});
const nodes02: Array<LearningPathNode> = [
const nodes02: LearningPathNode[] = [
// LearningPathNode03,
// LearningPathNode04,
// LearningPathNode05,