Пожалуйста, включите JavaScript.
Главная
Обзор
Помощь
Вход
jan
/
mustache.js
зеркало из
https://github.com/janl/mustache.js
Следить
1
В избранное
0
Форкнуть
0
Код
Задачи
0
Релизы
46
Вики
Активность
Просмотр исходного кода
improve test with undefined/null lookup hit using dot notation
tags/v2.1.1
David da Silva
Phillip Johnsen
11 лет назад
Родитель
fc6d73b353
Сommit
931f49b5da
3 измененных файлов
:
24 добавлений
и
1 удалений
Разделённый вид
Опции Diff
Показать статистику
Скачать Patch файл
Скачать Diff файл
+14
-1
test/_files/null_lookup_object.js
+6
-0
test/_files/null_lookup_object.mustache
+4
-0
test/_files/null_lookup_object.txt
+ 14
- 1
test/_files/null_lookup_object.js
Просмотреть файл
@@ -14,5 +14,18 @@
"name": "Chris",
"twitter": undefined
}
]
],
"favorites": {
"color": "blue",
"president": "Bush",
"show": "Futurama"
},
"mascot": {
"name": "Squid",
"favorites": {
"color": "orange",
"president": undefined,
"show": null
}
}
})
+ 6
- 0
test/_files/null_lookup_object.mustache
Просмотреть файл
@@ -1,3 +1,9 @@
{{#fobject}}
{{name}}'s twitter: {{#twitter}}{{.}}{{/twitter}}{{^twitter}}unknown{{/twitter}}.
{{/fobject}}
{{#mascot}}
{{name}}'s favorite color: {{#favorites.color}}{{.}}{{/favorites.color}}{{^favorites.color}}no one{{/favorites.color}}.
{{name}}'s favorite president: {{#favorites.president}}{{.}}{{/favorites.president}}{{^favorites.president}}no one{{/favorites.president}}.
{{name}}'s favorite show: {{#favorites.show}}{{.}}{{/favorites.show}}{{^favorites.show}}none{{/favorites.show}}.
{{/mascot}}
+ 4
- 0
test/_files/null_lookup_object.txt
Просмотреть файл
@@ -1,3 +1,7 @@
Flor's twitter: @florrts.
Miquel's twitter: unknown.
Chris's twitter: unknown.
Squid's favorite color: orange.
Squid's favorite president: no one.
Squid's favorite show: none.
Редактирование
Предпросмотр
Загрузка…
Отмена
Сохранить