Skip to content

Commit dbfaeba

Browse files
committed
Small updates
1 parent 9136682 commit dbfaeba

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

packages/core/src/Utils.ts

Lines changed: 3 additions & 3 deletions
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,5 +399,5 @@ 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
}

packages/core/src/configuration/Configuration.ts

Lines changed: 2 additions & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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)