From e16eb8c8d15fc121f3dd4da21eb48935847af8de Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 18 Aug 2021 20:23:34 +0300 Subject: [PATCH] Add stricter type check for TemplateSafeValueContainer in templateFormatter --- backend/src/templateFormatter.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/templateFormatter.ts b/backend/src/templateFormatter.ts index f7508ca4..f9e80d96 100644 --- a/backend/src/templateFormatter.ts +++ b/backend/src/templateFormatter.ts @@ -57,6 +57,9 @@ function isTemplateSafeValue(value: unknown): value is TemplateSafeValue { } export class TemplateSafeValueContainer { + // Fake property used for stricter type checks since TypeScript uses structural typing + _isTemplateSafeValueContainer: true; + [key: string]: TemplateSafeValue; constructor(data: Record = {}) {