| | |
Feature Introduction
- Supports parsing nested JSON strings, recursively parsing nested objects.
- Supports parsing array JSON strings, parsing the first JSON string in the array.
- Checks if the JSON string format is correct and outputs the error location.
- Supports line-by-line parsing of comments.
Example
Parsing Nested JSON String
{
"name": "test", // Name
"age": 10, // Age
"addr": "Chengdu, Sichuan", // Address
"cls_info": [ // Classes
{
"name": "Basketball Class", // Class Name
"teacher": "Mr. Zhang" // Teacher
},
{
"name": "Art Class", // Class Name
"teacher": "Mr. Li" // Teacher
}
]
}
After processing:
export interface IClsInfo {
name: string; // Class Name
teacher: string; // Teacher
}
export interface IGenerateObj {
name: string; // Name
age: number; // Age
addr: string; // Address
cls_info: IClsInfo[]; // Classes
}