Skip to content

Commit 8178d2b

Browse files
committed
Small updates
1 parent c0ce88e commit 8178d2b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/core/src/Utils.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ export function isEmpty(input: Record<string, unknown> | null | undefined | unkn
154154
return true;
155155
}
156156

157-
if (typeof input == "object") {
158-
return Object.keys(<Record<string, unknown>>input).length === 0;
157+
if (typeof input === "object") {
158+
return Object.getOwnPropertyNames(input).length === 0;
159159
}
160160

161161
return false;
@@ -399,7 +399,7 @@ export function toError(errorOrMessage: unknown, defaultMessage = "Unknown Error
399399
return new Error(errorOrMessage);
400400
}
401401

402-
return new Error(JSON.stringify(errorOrMessage) || defaultMessage);
402+
return new Error(stringify(errorOrMessage) || defaultMessage);
403403
}
404404

405405

packages/core/src/configuration/Configuration.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,9 @@ export class Configuration {
507507
private originalSettings?: Record<string, string>;
508508

509509
public applyServerSettings(serverSettings: ServerSettings): void {
510-
if (!this.originalSettings)
510+
if (!this.originalSettings) {
511511
this.originalSettings = JSON.parse(JSON.stringify(this.settings)) as Record<string, string>;
512+
}
512513

513514
this.services.log.trace(`Applying saved settings: v${serverSettings.version}`);
514515
this.settings = Object.assign(this.originalSettings, serverSettings.settings);

packages/core/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export {
6262
isMatch,
6363
parseQueryString,
6464
parseVersion,
65+
prune,
6566
randomNumber,
6667
startsWith,
6768
stringify,

0 commit comments

Comments
 (0)