Support Map and Set in #each block

Also support Map-keys in lookup-expressions.

See #1418 #1679
This commit is contained in:
Jakob Linskeseder
2023-09-04 23:20:43 +02:00
committed by Jay Linski
parent 8ce2be4496
commit ae83edd5c4
7 changed files with 100 additions and 12 deletions
+7
View File
@@ -387,6 +387,13 @@ describe('basic context', function () {
.toCompileTo('Goodbye beautiful world!');
});
it('nested paths with Map', function () {
expectTemplate('Goodbye {{alan/expression}} world!')
.withInput({ alan: new Map([['expression', 'beautiful']]) })
.withMessage('Nested paths access nested objects')
.toCompileTo('Goodbye beautiful world!');
});
it('nested paths with empty string value', function () {
expectTemplate('Goodbye {{alan/expression}} world!')
.withInput({ alan: { expression: '' } })