Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

9
LINES

< > BotCompany Repo | #1001918 // jsonDecodeMap

JavaX fragment (include)

static Map jsonDecodeMap(S s) {
  O o = jsonDecode(s);
  if (o instanceof L && empty((L) o))
    ret new HashMap;
  if (o instanceof Map)
    ret (Map) o;
  else
    throw fail("Not a JSON map: " + s);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 17 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ekrmjmnbrukm, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1001918
Snippet name: jsonDecodeMap
Eternal ID of this version: #1001918/1
Text MD5: 238fd49a620daa130d5d44172d39b790
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-12-28 20:19:13
Source code size: 211 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 780 / 2089
Referenced in: [show references]