File tree 1 file changed +25
-3
lines changed
1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ local encoderH = require "hjson.encoderH"
7
7
--- @field key any
8
8
--- @field value any
9
9
10
- --- #DES 'decode'
10
+ --- #DES 'hjson. decode'
11
11
---
12
12
--- decodes h/json
13
13
--- @param str string
28
28
--- @field invalidObjectsAsType boolean
29
29
30
30
31
- --- #DES 'encode_json '
31
+ --- #DES 'hjson.encode_to_json '
32
32
---
33
33
--- encodes json
34
34
--- @param obj any
@@ -39,7 +39,7 @@ local function encode_json(obj, options)
39
39
return _encoder :encode (obj )
40
40
end
41
41
42
- --- #DES 'encode_json '
42
+ --- #DES 'hjson.encode '
43
43
---
44
44
--- encodes hjson
45
45
--- @param obj any
@@ -58,12 +58,34 @@ local function encode(obj, options)
58
58
end
59
59
60
60
61
+ --- #DES 'hjson'
62
+ --- @class hjson
61
63
local hjson = {
62
64
encode = encode ,
65
+ --- #DES 'hjson.stringify'
66
+ ---
67
+ --- encodes hjson
68
+ --- @param obj any
69
+ --- @param options HjsonEncodeOptions
70
+ --- @return any
63
71
stringify = encode ,
64
72
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
65
79
stringify_to_json = encode_json ,
66
80
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
67
89
parse = decode
68
90
}
69
91
You can’t perform that action at this time.
0 commit comments