Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ASUnit/ASUnit.applescript
Binary file not shown.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ json.scpt: json.applescript
osacompile -o json.scpt json.applescript

test: json.scpt
osacompile -o ASUnit/ASUnit.scpt -x ASUnit/ASUnit.applescript
osascript tests.applescript
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,25 @@ set my_dict_2 to json's createDictWith({ {"foo", "bar"}, {"baz", 22} })
json's encode(my_dict_2)
-- {"foo": "bar", "baz": 22}
```

And also natively (which gives a small performance penalty):
```applescript
json's encode({glossary:¬
{GlossDiv:¬
{GlossList:¬
{GlossEntry:¬
{GlossDef:¬
{GlossSeeAlso:¬
["GML", "XML"], para:"A meta-markup language, used to create markup languages such as DocBook."} ¬
, GlossSee:"markup", Acronym:"SGML", GlossTerm:"Standard Generalized Markup Language", Abbrev:"ISO 8879:1986", SortAs:"SGML", id:¬
"SGML"} ¬
}, title:"S"} ¬
, title:"example glossary"} ¬
})
```

Decoding is also available (dictionaries with keys which contain spaces are not supported):
```applescript
set dict to {foo:"bar"}
json's decode(json's encode(dict)) -- {foo: "bar"}
```
Loading