File tree Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Expand file tree Collapse file tree 3 files changed +19
-7
lines changed Original file line number Diff line number Diff line change 1- # v0.2.1
1+ # v0.3.0
22
33## What's Changed
44
5- - add other kotlin targets
6- - use custom hexToDecimal instead of java BigInteger
5+ - optimize memory usage
6+ - add parse json5 token
Original file line number Diff line number Diff line change 22
33kotlin multiplatform json5 for [ kotlinx.serialization] ( https://github.com/Kotlin/kotlinx.serialization )
44
5- its principle is to convert a JSON5 string into a valid JsonElement object, which facilitates interoperability with kotlinx serialization
6-
75## Usage
86
97``` kotlin
10- implementation(" li.songe:json5:0.2 .0" )
8+ implementation(" li.songe:json5:0.3 .0" )
119```
1210
1311## Decode
@@ -38,6 +36,20 @@ data class A(val id:Int)
3836val a = json.decodeFromJson5String<A >(" {id:0, b:''}" )
3937```
4038
39+ ### Decode Json5Token
40+
41+ Json5String -> Json5Token
42+
43+ ``` kotlin
44+ val (element, ranges) = Json5 .parseToJson5ElementAndRanges(" {a:1}" )
45+ ```
46+
47+ Loose Json5String -> Json5Token
48+
49+ ``` kotlin
50+ val ranges = Json5 .parseToJson5LooseRanges(" {a:1,]{" )
51+ ```
52+
4153## Encode
4254
4355JsonElement -> Json5String
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ kotlin {
4747mavenPublishing {
4848 publishToMavenCentral(SonatypeHost .CENTRAL_PORTAL )
4949 signAllPublications()
50- coordinates(" li.songe" , " json5" , " 0.2.1 " )
50+ coordinates(" li.songe" , " json5" , " 0.3.0 " )
5151
5252 val repoUrl = " https://github.com/lisonge/kotlin-json5"
5353 pom {
You can’t perform that action at this time.
0 commit comments