Skip to content

Commit

Permalink
Build: (8db1a16) Merge pull request #38 from Alex-NRCan/feat-typing-m…
Browse files Browse the repository at this point in the history
…oved-schemas

Progress: Steps examples, better typing, moved schema validators to root (#38)
  • Loading branch information
jolevesq committed Oct 25, 2023
1 parent 72b6087 commit 5953f4f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27278,10 +27278,10 @@ function _classCallCheck(instance, Constructor) {
// EXTERNAL MODULE: ./node_modules/ajv/lib/ajv.js
var ajv = __webpack_require__(96);
var ajv_default = /*#__PURE__*/__webpack_require__.n(ajv);
;// CONCATENATED MODULE: ./src/schema-validator-data.json
const schema_validator_data_namespaceObject = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"GeoChart Data Schema","description":"This Schema validator validates the GeoChart data.","type":"object","properties":{"labels":{"description":"The labels to use for the X axis.","type":"array","items":{"type":"string"}},"datasets":{"description":"The mandatory datasets information to use to build the chart.","type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"data":{"oneOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"object"}]},"backgroundColor":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"borderColor":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"borderWidth":{"type":"integer"}},"required":["data"]}}},"required":["datasets"]}');
;// CONCATENATED MODULE: ./src/schema-validator-options.json
const schema_validator_options_namespaceObject = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"GeoChart Options Schema","description":"This Schema validator validates the GeoChart options.","type":"object","properties":{"responsive":{"type":"boolean"},"plugins":{"type":"object","properties":{"legend":{"type":"object","properties":{"display":{"type":"boolean"}}}}},"geochart":{"type":"object","properties":{"chart":{"enum":["line","bar","pie","doughnut"],"default":"line","description":"Supported types of chart."}}}},"required":["geochart"]}');
;// CONCATENATED MODULE: ./schema-data.json
const schema_data_namespaceObject = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"GeoChart Data Schema","description":"This Schema validator validates the GeoChart data.","type":"object","properties":{"labels":{"description":"The labels to use for the X axis.","type":"array","items":{"type":"string"}},"datasets":{"description":"The mandatory datasets information to use to build the chart.","type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"data":{"oneOf":[{"type":"array","items":{"type":"number"}},{"type":"array","items":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]}},{"type":"object"}]},"backgroundColor":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"borderColor":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"borderWidth":{"type":"integer"}},"required":["data"]}}},"required":["datasets"]}');
;// CONCATENATED MODULE: ./schema-options.json
const schema_options_namespaceObject = JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","title":"GeoChart Options Schema","description":"This Schema validator validates the GeoChart options.","type":"object","properties":{"responsive":{"type":"boolean"},"plugins":{"type":"object","properties":{"legend":{"type":"object","properties":{"display":{"type":"boolean"}}}}},"geochart":{"type":"object","properties":{"chart":{"enum":["line","bar","pie","doughnut"],"default":"line","description":"Supported types of chart."}}}},"required":["geochart"]}');
;// CONCATENATED MODULE: ./src/schema-validator.ts


Expand Down Expand Up @@ -27313,15 +27313,15 @@ function SchemaValidator() {
*/
_defineProperty(this, "validateData", function (data) {
// Redirect
return _this.validateJsonSchema(schema_validator_data_namespaceObject, data);
return _this.validateJsonSchema(schema_data_namespaceObject, data);
});
/**
* Validates the options input parameters.
* @param options object the options json object to validate
*/
_defineProperty(this, "validateOptions", function (options) {
// Redirect
return _this.validateJsonSchema(schema_validator_options_namespaceObject, options);
return _this.validateJsonSchema(schema_options_namespaceObject, options);
});
/**
* Validates the a jsonObj using a schema validator.
Expand Down

0 comments on commit 5953f4f

Please sign in to comment.