Add stricter type check for TemplateSafeValueContainer in templateFormatter
This commit is contained in:
parent
e6286c3eaa
commit
e16eb8c8d1
1 changed files with 3 additions and 0 deletions
|
@ -57,6 +57,9 @@ function isTemplateSafeValue(value: unknown): value is TemplateSafeValue {
|
||||||
}
|
}
|
||||||
|
|
||||||
export class TemplateSafeValueContainer {
|
export class TemplateSafeValueContainer {
|
||||||
|
// Fake property used for stricter type checks since TypeScript uses structural typing
|
||||||
|
_isTemplateSafeValueContainer: true;
|
||||||
|
|
||||||
[key: string]: TemplateSafeValue;
|
[key: string]: TemplateSafeValue;
|
||||||
|
|
||||||
constructor(data: Record<string, TemplateSafeValue> = {}) {
|
constructor(data: Record<string, TemplateSafeValue> = {}) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue