File tree 3 files changed +11
-1
lines changed
3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
- Pedantic style checking
6
6
- Detailed instructions in README
7
+ - Add documentations
7
8
8
9
## 0.0.1
9
10
Original file line number Diff line number Diff line change 1
1
import 'dart:convert' ;
2
2
3
+ /// ElementNotFound Exception implementation, currently simply prints the
4
+ /// error message
3
5
class ElementNotFoundException implements Exception {
4
6
ElementNotFoundException (String errorString) {
5
7
print (errorString);
6
8
}
7
9
}
8
10
11
+ /// JSONTraverse class, implements the query method as well
9
12
class JSONTraverse {
10
13
Map <String , dynamic > decodedJSON;
14
+
15
+ /// The constructor converts the `jsonString` to `Map<String, dynamic>`
16
+ /// which is used by the `query` method.
11
17
JSONTraverse (jsonString) {
12
18
decodedJSON = jsonDecode (jsonString);
13
19
}
14
20
21
+ /// The query method takes `queryString` and then splits into an array of
22
+ /// strings. The converted map(that is, `decodedJSON` ) is then traversed using
23
+ /// the splitted strings, reducing it at every step.
15
24
dynamic query (String queryString) {
16
25
var splittedString = queryString.split ('.' );
17
26
dynamic reduced = decodedJSON;
Original file line number Diff line number Diff line change 1
1
name : json_traverse
2
2
version : 0.0.2
3
3
4
- description : Parse deeply nested JSON using simple query strings.
4
+ description : Parse deeply nested JSON using simple query strings with dot separator .
5
5
homepage : https://github.com/ayan-b/json_traverse
6
6
7
7
environment :
You can’t perform that action at this time.
0 commit comments