From 6220f503601126f03e26dfe3755e04b7ab1ca251 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 5 Aug 2020 09:28:02 +0100 Subject: [PATCH] delint --- src/utils/objects.ts | 4 ++-- src/widgets/WidgetApi.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/objects.ts b/src/utils/objects.ts index 658491188d..bc74ab9ee0 100644 --- a/src/utils/objects.ts +++ b/src/utils/objects.ts @@ -24,7 +24,7 @@ type ObjectExcluding = {[k in Exclude(a: O, props: P): ObjectExcluding { +export function objectExcluding>(a: O, props: P): ObjectExcluding { // We use a Map to avoid hammering the `delete` keyword, which is slow and painful. const tempMap = new Map(Object.entries(a) as [keyof O, any][]); for (const prop of props) { @@ -45,7 +45,7 @@ export function objectExcluding(a: O, props * @param props The property names to keep. * @returns The new object with only the provided properties. */ -export function objectWithOnly(a: O, props: P): {[k in P[number]]: O[k]} { +export function objectWithOnly>(a: O, props: P): {[k in P[number]]: O[k]} { const existingProps = Object.keys(a) as (keyof O)[]; const diff = arrayDiff(existingProps, props); if (diff.removed.length === 0) { diff --git a/src/widgets/WidgetApi.ts b/src/widgets/WidgetApi.ts index 4775c30c95..039f72ce0f 100644 --- a/src/widgets/WidgetApi.ts +++ b/src/widgets/WidgetApi.ts @@ -141,7 +141,7 @@ export class WidgetApi extends EventEmitter { private replyToRequest(payload: ToWidgetRequest, reply: any) { if (!window.parent) return; - const request = objectClone(payload); + const request: ToWidgetRequest & {response?: any} = objectClone(payload); request.response = reply; window.parent.postMessage(request, this.origin);