Skip to content

Commit 71beb8e

Browse files
committed
#608: processed more Snyk and CodeRabbit feedback
1 parent 0f40a03 commit 71beb8e

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

packages/runtime/src/server/ServerBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export default class RuntimeBuilder
9595
{
9696
const trustKey = configuration.trustKey;
9797
const gateway = configuration.gateway ? this.#buildRemoteGateway(configuration.gateway) : undefined;
98-
const registerAtGateway = gateway !== undefined;
98+
const registerAtGateway = gateway !== undefined; // if we have a gateway, the worker needs to register itself at it.
9999
const executionManager = this.#buildExecutionManager(configuration.segments);
100100

101101
return new LocalWorker({ url, trustKey, gateway, registerAtGateway, executionManager });

packages/services/test/repository/fixtures/sourcingManager.fixture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { NotImplemented } from '@jitar/errors';
3-
import { File, FileNotFound, Module, LocalSourcingManager } from '@jitar/sourcing';
3+
import { File, FileNotFound, LocalSourcingManager } from '@jitar/sourcing';
44

55
import { FILENAMES } from './filenames.fixture';
66
import { FILES } from './files.fixtures';

packages/sourcing/src/files/LocalFileSystem.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ export default class LocalFileSystem implements FileSystem
7474

7575
async mimeType(location: string): Promise<string | undefined>
7676
{
77-
return mime.lookup(location) || undefined;
77+
const mimeType = mime.lookup(location);
78+
79+
if (mimeType === false)
80+
{
81+
return undefined;
82+
}
83+
84+
return mimeType;
7885
}
7986

8087
async write(location: string, content: string): Promise<void>

packages/sourcing/src/modules/ImportManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Module from './types/Module';
66

77
export default class ImportManager implements ModuleImporter
88
{
9-
#moduleLocator: ModuleLocator;
9+
readonly #moduleLocator: ModuleLocator;
1010

1111
constructor(moduleLocator: ModuleLocator)
1212
{

packages/sourcing/src/modules/RemoteImportManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import RemoteModuleLocator from './RemoteModuleLocator';
44

55
export default class RemoteImportManager extends ImportManager
66
{
7+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
78
constructor(location: string)
89
{
910
super(new RemoteModuleLocator(location));

packages/sourcing/src/modules/RemoteModuleLocator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ import ModuleLocator from './interfaces/ModuleLocator';
44

55
export default class RemoteModuleLocator implements ModuleLocator
66
{
7+
// This is a placeholder class because remote module loading
8+
// is currently not allowed due to security reasons.
9+
710
// eslint-disable-next-line @typescript-eslint/no-unused-vars
811
constructor(location: string)
912
{
1013
// This constructor is intentionally empty.
11-
// Remote module loading is currently not allowed due to security reasons.
14+
// In case we ever want to allow remote module loading,
15+
// we need the location to be passed in.
1216
}
1317

1418
locate(filename: string): string

0 commit comments

Comments
 (0)