From dea3de144c89e59cf45dc486103abee66c6ec141 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 23 Feb 2024 09:58:27 +0100 Subject: [PATCH] Expand Nuxt data script --- _posts/2024-02-06-making-sense-of-nuxt-data.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/_posts/2024-02-06-making-sense-of-nuxt-data.md b/_posts/2024-02-06-making-sense-of-nuxt-data.md index b885899..918ffb7 100644 --- a/_posts/2024-02-06-making-sense-of-nuxt-data.md +++ b/_posts/2024-02-06-making-sense-of-nuxt-data.md @@ -80,6 +80,9 @@ def _parseNuxtDict(j, d): return _parseNuxtDict(j, j[d[1]]) elif d[0] == 'Reactive': return None # not supported + elif d[0] == 'null': + # dict-as-list, ignoring first item + return {k: _parseNuxtDict(j, j[v]) for (k,v) in zip(d[1::2], d[2::2])} else: return [_parseNuxtDict(j, j[v]) for v in d] else: