File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ local encoderH = require "hjson.encoderH"
77--- @field key any
88--- @field value any
99
10- --- #DES 'decode'
10+ --- #DES 'hjson. decode'
1111---
1212--- decodes h/json
1313--- @param str string
2828--- @field invalidObjectsAsType boolean
2929
3030
31- --- #DES 'encode_json '
31+ --- #DES 'hjson.encode_to_json '
3232---
3333--- encodes json
3434--- @param obj any
@@ -39,7 +39,7 @@ local function encode_json(obj, options)
3939 return _encoder :encode (obj )
4040end
4141
42- --- #DES 'encode_json '
42+ --- #DES 'hjson.encode '
4343---
4444--- encodes hjson
4545--- @param obj any
@@ -58,12 +58,34 @@ local function encode(obj, options)
5858end
5959
6060
61+ --- #DES 'hjson'
62+ --- @class hjson
6163local hjson = {
6264 encode = encode ,
65+ --- #DES 'hjson.stringify'
66+ ---
67+ --- encodes hjson
68+ --- @param obj any
69+ --- @param options HjsonEncodeOptions
70+ --- @return any
6371 stringify = encode ,
6472 encode_to_json = encode_json ,
73+ --- #DES 'hjson.stringify_to_json'
74+ ---
75+ --- encodes json
76+ --- @param obj any
77+ --- @param options HjsonEncodeOptions
78+ --- @return any
6579 stringify_to_json = encode_json ,
6680 decode = decode ,
81+ --- #DES 'hjson.parse'
82+ ---
83+ --- decodes h/json
84+ --- @param str string
85+ --- @param strict boolean
86+ --- @param object_hook fun ( obj : table ): table
87+ --- @param object_pairs_hook fun ( pairs : HjsonKeyValuePair[] ): HjsonKeyValuePair[]
88+ --- @return any
6789 parse = decode
6890}
6991
You can’t perform that action at this time.
0 commit comments