diff --git a/src/http/request/form-decoding.capability.ts b/src/http/request/form-decoding.capability.ts index 6cb51ac..420db1e 100644 --- a/src/http/request/form-decoding.capability.ts +++ b/src/http/request/form-decoding.capability.ts @@ -55,10 +55,11 @@ class FormDecodingCapability extends RequestCapability> implements FormDecoding { - constructor( - private readonly _transform: RequestValueTransformer, - ) { + readonly #transform: RequestValueTransformer; + + constructor(transform: RequestValueTransformer) { super(); + this.#transform = transform; } for( @@ -79,7 +80,7 @@ class FormDecodingCapability return context.next( handler, requestExtension>({ - requestBody: await this._transform(params, context as RequestContext), + requestBody: await this.#transform(params, context as RequestContext), }), ); }; diff --git a/src/http/request/http-forwarding.capability.ts b/src/http/request/http-forwarding.capability.ts index 88197ee..bf77f2f 100644 --- a/src/http/request/http-forwarding.capability.ts +++ b/src/http/request/http-forwarding.capability.ts @@ -28,13 +28,16 @@ export interface HttpForwarding extends RequestCapability { */ class HttpForwardingCapability extends RequestCapability implements HttpForwarding { - constructor(private readonly _trust: HttpForwardTrust) { + readonly #trust: HttpForwardTrust; + + constructor(trust: HttpForwardTrust) { super(); + this.#trust = trust; } for(handler: RequestHandler): RequestHandler { return ({ request, next }) => { - const addresses = lazyValue(() => HttpAddressRep.by(request, this._trust)); + const addresses = lazyValue(() => HttpAddressRep.by(request, this.#trust)); return next( handler, diff --git a/src/http/request/json-parsing.capability.ts b/src/http/request/json-parsing.capability.ts index 1da7795..c16bb23 100644 --- a/src/http/request/json-parsing.capability.ts +++ b/src/http/request/json-parsing.capability.ts @@ -57,8 +57,11 @@ class JsonParsingCapability extends RequestCapability> implements JsonParsing { - constructor(private readonly _transform: RequestValueTransformer) { + readonly #transform: RequestValueTransformer; + + constructor(transform: RequestValueTransformer) { super(); + this.#transform = transform; } for( @@ -84,7 +87,7 @@ class JsonParsingCapability return next( handler, requestExtension>({ - requestBody: await this._transform(json, context as RequestContext), + requestBody: await this.#transform(json, context as RequestContext), }), ); }; diff --git a/src/testing/test-http-server.ts b/src/testing/test-http-server.ts index 8ffa66c..b315adf 100644 --- a/src/testing/test-http-server.ts +++ b/src/testing/test-http-server.ts @@ -24,35 +24,35 @@ export class TestHttpServer { * @returns A promise resolved to started server. */ static start(): Promise { - return new TestHttpServer()._start(); + return new TestHttpServer().#start(); } /** * @internal */ - private _listener: RequestListener; + #listener: RequestListener; /** * @internal */ - private _server!: Server; + #server!: Server; private constructor() { - this._listener = noop; + this.#listener = noop; } /** * HTTP server instance. */ get server(): Server { - return this._server; + return this.#server; } /** * An address the service is bound to. */ get address(): AddressInfo { - return this._server.address() as AddressInfo; + return this.#server.address() as AddressInfo; } /** @@ -63,7 +63,7 @@ export class TestHttpServer { * @returns `this` instance. */ listenBy(listener: RequestListener): this { - this._listener = listener; + this.#listener = listener; return this; } @@ -113,9 +113,9 @@ export class TestHttpServer { /** * @internal */ - private _start(): Promise { + #start(): Promise { return new Promise((resolve, reject) => { - const server = (this._server = createServer((request, response) => this._listener(request, response))); + const server = (this.#server = createServer((request, response) => this.#listener(request, response))); server.on('error', reject); server.on('listening', () => resolve(this));