Skip to content

Commit

Permalink
Explain KeymanagerServer opts merging
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Apr 3, 2022
1 parent 31c64f5 commit f11081e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/keymanager-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@ export class KeymanagerServer {

constructor(optsArg: Partial<RestApiOptions>, modules: IRestApiModules) {
this.logger = modules.logger;

// Apply opts defaults
const opts = {
...restApiOptionsDefault,
// optsArg is a Partial type, any of its properties can be undefined. If port is set to undefined,
// it overrides the default port value in restApiOptionsDefault to be undefined.
...Object.fromEntries(Object.entries(optsArg).filter(([_, v]) => v != null)),
};

Expand Down

0 comments on commit f11081e

Please sign in to comment.