We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2ae5b9 commit fb92f71Copy full SHA for fb92f71
lib/formats/json/parser.js
@@ -1,9 +1,5 @@
1
-var Spec02 = require("../../specs/spec_0_2.js");
+function JSONParser() {
2
3
-const spec02 = new Spec02();
4
-
5
-function JSONParser(_spec) {
6
- this.spec = (_spec) ? _spec : new Spec02();
7
}
8
9
/**
@@ -45,13 +41,10 @@ function validate_spec(payload, spec) {
45
41
46
42
JSONParser.prototype.parse = function(payload) {
47
43
48
- // Level 0 of validation: is that string? is that JSON?
49
- var valid0 = validate_and_parse_as_json(payload);
50
51
- // Level 1 of validation: is that follow a spec?
52
- var valid1 = validate_spec(valid0, this.spec);
44
+ //is that string? is that JSON?
+ var valid = validate_and_parse_as_json(payload);
53
54
- return valid1;
+ return valid;
55
56
57
module.exports = JSONParser;
0 commit comments