From 3b7e9885947c70e95782f5bb815ae39d03b8c161 Mon Sep 17 00:00:00 2001 From: William Killerud Date: Mon, 13 May 2024 15:01:44 +0200 Subject: [PATCH] fix: update dependency typings --- lib/layout.js | 21 ++++++--------------- package.json | 4 ++-- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/lib/layout.js b/lib/layout.js index 4e56ccca..03ecfe77 100644 --- a/lib/layout.js +++ b/lib/layout.js @@ -5,13 +5,9 @@ import { HttpIncoming, - // @ts-ignore template, - // @ts-ignore isFunction, - // @ts-ignore pathnameBuilder, - // @ts-ignore uriIsRelative, AssetCss, AssetJs, @@ -147,7 +143,7 @@ export default class PodiumLayout { * @see https://podium-lib.io/docs/layout/context * @see https://podium-lib.io/docs/podlet/context * - * @type {LayoutContext} + * @type {Context} */ context; @@ -294,14 +290,12 @@ export default class PodiumLayout { // Join metric streams this.httpProxy.metrics.pipe(this.metrics); - // @ts-ignore this.context.metrics.pipe(this.metrics); this.client.metrics.pipe(this.metrics); // Register proxy endpoints - // @ts-ignore + // @ts-expect-error Not typed yet. Coming in a future TypeScript Tuesdayâ„¢ this.client.registry.on('set', (key, item) => { - // @ts-ignore this.httpProxy.register(key, item.newVal); }); } @@ -561,8 +555,9 @@ export default class PodiumLayout { incoming.css = [...this.cssRoute]; incoming.js = [...this.jsRoute]; - // @ts-ignore + // @ts-expect-error Context hasn't been updated yet with the new typings for HttpIncoming. if (context) await this.context.process(incoming); + // @ts-expect-error Proxy hasn't been updated yet with the new typings for HttpIncoming. if (proxy) await this.httpProxy.process(incoming); return incoming; @@ -587,7 +582,7 @@ export default class PodiumLayout { middleware() { return async (req, res, next) => { const incoming = new HttpIncoming(req, res, res.locals); - // @ts-ignore + // @ts-expect-error The API here is a bit odd. You assign a string, but the `set` constructs a URL from it. incoming.url = `${req.protocol}://${req.get('host')}${ req.originalUrl }`; @@ -660,11 +655,7 @@ export default class PodiumLayout { #sanitize(uri, prefix = false) { const pathname = prefix ? this.#pathname : ''; if (uri) { - // @ts-ignore - return uriIsRelative(uri) - ? // @ts-ignore - pathnameBuilder(pathname, uri) - : uri; + return uriIsRelative(uri) ? pathnameBuilder(pathname, uri) : uri; } return uri; } diff --git a/package.json b/package.json index 11d67c89..ac0f67b6 100644 --- a/package.json +++ b/package.json @@ -39,10 +39,10 @@ "dependencies": { "@metrics/client": "2.5.2", "@podium/client": "5.0.10", - "@podium/context": "5.0.4", + "@podium/context": "5.0.11", "@podium/proxy": "5.0.8", "@podium/schemas": "5.0.0", - "@podium/utils": "5.0.3", + "@podium/utils": "5.0.6", "abslog": "2.4.2", "ajv": "8.12.0", "lodash.merge": "4.6.2",