Add stricter type check for TemplateSafeValueContainer in templateFormatter

This commit is contained in:
Dragory 2021-08-18 20:23:34 +03:00
parent e6286c3eaa
commit e16eb8c8d1
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -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<string, TemplateSafeValue> = {}) {