about summary refs log tree commit diff stats
path: root/js/baba-yaga/debug-json-raw.baba
blob: bac741253b7a091674199b65996442c320b07212 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Test to see raw JSON string value
simpleData : {name: "Alice", age: 30};

// Convert to JS object
jsObj : io.tableToObject simpleData;

// Try to stringify
jsonStr : io.callJS "JSON.stringify" [jsObj];

// Show the raw values
result : when jsonStr is
  Ok str then {jsObj: jsObj, jsonStr: str, success: true}
  Err msg then {jsObj: jsObj, error: msg, success: false};

result;