Skip to content
Snippets Groups Projects
Commit 771f8cd0 authored by michael.minelli's avatar michael.minelli
Browse files

Merge branch 'esm-migration-and-dependencies-update' into v4.0

parents 6e78095b f965766a
No related branches found
No related tags found
No related merge requests found
import AssignmentFile from '../../types/Dojo/AssignmentFile'; import AssignmentFile from '../../types/Dojo/AssignmentFile.js';
import DojoStatusCode from '../../types/Dojo/DojoStatusCode'; import DojoStatusCode from '../../types/Dojo/DojoStatusCode.js';
import Json5FileValidator from '../Json5FileValidator'; import Json5FileValidator from '../Json5FileValidator.js';
import * as Gitlab from '@gitbeaker/rest'; import * as Gitlab from '@gitbeaker/rest';
import GitlabPipelineStatus from '../../types/Gitlab/GitlabPipelineStatus'; import GitlabPipelineStatus from '../../types/Gitlab/GitlabPipelineStatus.js';
import GitlabManager from '../../../managers/GitlabManager'; import GitlabManager from '../../../managers/GitlabManager.js';
class SharedAssignmentHelper { class SharedAssignmentHelper {
......
...@@ -9,7 +9,7 @@ class LazyVal<T> { ...@@ -9,7 +9,7 @@ class LazyVal<T> {
get value(): Promise<T> { get value(): Promise<T> {
return new Promise<T>(resolve => { return new Promise<T>(resolve => {
if ( this.val === undefined ) { if ( this.val === undefined ) {
Promise.resolve(this.valLoader()).then((value: T) => { void Promise.resolve(this.valLoader()).then((value: T) => {
this.val = value; this.val = value;
resolve(value); resolve(value);
}); });
......
...@@ -51,6 +51,10 @@ class Toolbox { ...@@ -51,6 +51,10 @@ class Toolbox {
public getKeysWithPrefix(obj: object, prefix: string): Array<string> { public getKeysWithPrefix(obj: object, prefix: string): Array<string> {
return Object.keys(obj).filter(key => key.startsWith(prefix)); return Object.keys(obj).filter(key => key.startsWith(prefix));
} }
public isString(value: unknown): value is string {
return typeof value === 'string' || value instanceof String;
}
} }
......
...@@ -75,9 +75,9 @@ class RecursiveFilesStats { ...@@ -75,9 +75,9 @@ class RecursiveFilesStats {
if ( callback ) { if ( callback ) {
fileDir.forEach(item => { fileDir.forEach(item => {
this.getStat(item.path, absoluteBasePath, options).then(stat => { void this.getStat(item.path, absoluteBasePath, options).then(stat => {
if ( stat.isDirectory!() ) { if ( stat.isDirectory!() ) {
this.getFiles(absoluteBasePath, item.path, options, [], callback).then(); void this.getFiles(absoluteBasePath, item.path, options, [], callback).then();
} }
callback(item.path, stat); callback(item.path, stat);
}); });
......
import winston from 'winston'; import winston from 'winston';
import SharedConfig from '../config/SharedConfig'; import SharedConfig from '../config/SharedConfig.js';
import * as Transport from 'winston-transport'; import * as Transport from 'winston-transport';
......
import axios from 'axios'; import axios from 'axios';
import SharedConfig from '../config/SharedConfig'; import SharedConfig from '../config/SharedConfig.js';
import * as GitlabCore from '@gitbeaker/core'; import * as GitlabCore from '@gitbeaker/core';
import { GitbeakerRequestError } from '@gitbeaker/requester-utils'; import { GitbeakerRequestError } from '@gitbeaker/requester-utils';
import { Gitlab, PipelineSchema, ProjectSchema, UserSchema } from '@gitbeaker/rest'; import { Gitlab, PipelineSchema, ProjectSchema, UserSchema } from '@gitbeaker/rest';
import GitlabToken from '../types/Gitlab/GitlabToken'; import GitlabToken from '../types/Gitlab/GitlabToken.js';
class SharedGitlabManager { class SharedGitlabManager {
......
import ImmutableFileDescriptor from './ImmutableFileDescriptor'; import ImmutableFileDescriptor from './ImmutableFileDescriptor.js';
import { z } from 'zod'; import { z } from 'zod';
......
import Icon from '../Icon'; import Icon from '../Icon.js';
import { z } from 'zod'; import { z } from 'zod';
...@@ -19,7 +19,7 @@ const ExerciseResultsFile = z.object({ ...@@ -19,7 +19,7 @@ const ExerciseResultsFile = z.object({
icon : z.enum(Object.keys(Icon) as [ firstKey: string, ...otherKeys: Array<string> ]).optional(), icon : z.enum(Object.keys(Icon) as [ firstKey: string, ...otherKeys: Array<string> ]).optional(),
itemsOrInformations: z.union([ z.array(z.string()), z.string() ]) itemsOrInformations: z.union([ z.array(z.string()), z.string() ])
})) }))
.optional() .optional()
}).strict().transform(value => { }).strict().transform(value => {
if ( value.successfulTests === undefined && value.successfulTestsList !== undefined ) { if ( value.successfulTests === undefined && value.successfulTestsList !== undefined ) {
value.successfulTests = value.successfulTestsList.length; value.successfulTests = value.successfulTestsList.length;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment