Skip to content

Commit

Permalink
Merge pull request #17 from onhernandes/fix/add-valid-Parser
Browse files Browse the repository at this point in the history
add valid to Parser proto
  • Loading branch information
onhernandes authored Jul 28, 2020
2 parents 5949bc0 + 464da4c commit 3495abb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parserblade",
"version": "1.1.0",
"version": "1.1.1",
"description": "The easiest parser for JSON, XML, CSV and YAML. Use it as simple as JSON.stringify() or JSON.parse(). All in one place.",
"homepage": "https://onhernandes.github.io/parserblade",
"author": {
Expand Down
10 changes: 10 additions & 0 deletions src/Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ Parser.prototype.stringify = function stringify (data, options) {
return this.strategy.stringify(data, options)
}

/**
* Parser.prototype.valid - Exposes the valid() method from strategy. Checks if given data is valid
*
* @param {string} data
* @param {object} options
*/
Parser.prototype.valid = function stringify (data, options) {
return this.strategy.valid(data, options)
}

Parser.prototype.get = function get (data, path) {}

Parser.prototype.has = function has (data, path) {}
Expand Down

0 comments on commit 3495abb

Please sign in to comment.