Skip to content

Commit b814aad

Browse files
Copilothossain-khan
andcommitted
Remove parseToAny API and migrate all tests to use type-safe parse() method
Co-authored-by: hossain-khan <[email protected]>
1 parent e9d0f1e commit b814aad

File tree

4 files changed

+196
-162
lines changed

4 files changed

+196
-162
lines changed

lib/src/main/kotlin/dev/hossain/json5kt/JSON5.kt

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ object JSON5 {
2525
return JSON5Value.from(result)
2626
}
2727

28-
/**
29-
* Parses a JSON5 string into a raw Kotlin object without type conversion.
30-
*
31-
* @param text JSON5 text to parse
32-
* @return The parsed value (Map, List, String, Number, Boolean, or null)
33-
* @throws JSON5Exception if the input is invalid JSON5
34-
*/
35-
fun parseToAny(text: String): Any? {
36-
return JSON5Parser.parse(text)
37-
}
38-
3928
/**
4029
* Parses a JSON5 string into a strongly-typed JSON5Value, with a reviver function.
4130
*
@@ -49,18 +38,6 @@ object JSON5 {
4938
return JSON5Value.from(result)
5039
}
5140

52-
/**
53-
* Parses a JSON5 string into a raw Kotlin object without type conversion, with a reviver function.
54-
*
55-
* @param text JSON5 text to parse
56-
* @param reviver A function that transforms the parsed values
57-
* @return The parsed value (Map, List, String, Number, Boolean, or null)
58-
* @throws JSON5Exception if the input is invalid JSON5
59-
*/
60-
fun parseToAny(text: String, reviver: (key: String, value: Any?) -> Any?): Any? {
61-
return JSON5Parser.parse(text, reviver)
62-
}
63-
6441
/**
6542
* Serializes a Kotlin object to a JSON5 string.
6643
*

0 commit comments

Comments
 (0)