-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom JS object parser. See #25
- Loading branch information
Showing
7 changed files
with
198 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
import { XMLBuilder } from "../interfaces" | ||
import { ObjectReader } from "./ObjectReader" | ||
import { BaseReader } from "./BaseReader" | ||
|
||
/** | ||
* Parses XML nodes from JSON string. | ||
* Parses XML nodes from a JSON string. | ||
*/ | ||
export class JSONReader { | ||
export class JSONReader extends BaseReader<string> { | ||
|
||
/** | ||
* Parses the given document representation. | ||
* | ||
* @param node - node receive parsed XML nodes | ||
* @param str - JSON string to parse | ||
*/ | ||
parse(node: XMLBuilder, str: string): XMLBuilder { | ||
return new ObjectReader(node.options).parse(node, JSON.parse(str)) | ||
_parse(node: XMLBuilder, str: string): XMLBuilder { | ||
return new ObjectReader(this._builderOptions).parse(node, JSON.parse(str)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.