handle json objects without all keys

This commit is contained in:
Philip Monk 2018-10-24 15:08:15 -07:00
parent db08708fe6
commit eaa65a9e75
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC

View File

@ -5384,6 +5384,23 @@
=/ ten ~|(key+key.wer (wit.wer (~(got by jom) key.wer)))
?~(t.wer ten [ten ((ot-raw t.wer) jom)])
==
::
++ ou :: object of units
|* wer/(pole {cord fist})
|= jon/json
?> ?=({$o *} jon)
((ou-raw wer) p.jon)
:: :: ++ou-raw:dejs:format
++ ou-raw :: object of units
|* wer/(pole {cord fist})
|= jom/(map @t json)
?- wer :: mint-vain on empty
:: {{key/@t wit/*} t/*}
{{key/@t *} t/*}
=> .(wer [[* wit] *]=wer)
=/ ten ~|(key+key.wer (wit.wer (~(get by jom) key.wer)))
?~(t.wer ten [ten ((ou-raw t.wer) jom)])
==
:: :: ++om:dejs:format
++ om :: object as map
|* wit/fist
@ -5416,6 +5433,16 @@
|= jon/json ^+ (wonk *sab)
?> ?=({$s *} jon)
(rash p.jon sab)
:: :: ++uf:dejs:format
++ uf :: unit fall
|* [def/* wit/fist]
|= jon/(unit json)
?~(jon def (wit u.jon))
:: :: ++un:dejs:format
++ un :: unit need
|* wit/fist
|= jon/(unit json)
(wit (need jon))
:: :: ++ul:dejs:format
++ ul :: null
|=(jon/json ?~(jon ~ !!))