fix: where-filter null handling (#457)

This commit is contained in:
Martin Schuster
2022-01-28 22:43:38 +08:00
committed by GitHub
parent 2717dae127
commit 9da41c8a37
2 changed files with 16 additions and 1 deletions
+12
View File
@@ -183,6 +183,18 @@ describe('filters/array', function () {
- Boring sneakers
`)
})
it('should support filter by null property', function () {
return test(`{% assign untyped_products = products | where: "type", null %}
Untyped products:
{% for product in untyped_products -%}
- {{ product.title }}
{% endfor %}`, { products }, `
Untyped products:
- Coffee mug
- Limited edition sneakers
- Boring sneakers
`)
})
it('should support nested property', async function () {
const authors = [
{ name: 'Alice', books: { year: 2019 } },