diff --git a/dist/protocol.esm.js b/dist/protocol.esm.js index 725de27d5deda33d11ce966afb2033e475d59046..ad8f994d584c683cf4f518422065f219aa493977 100644 --- a/dist/protocol.esm.js +++ b/dist/protocol.esm.js @@ -27,7 +27,7 @@ class GenericProtocol { constructor(schema, services) { this.schema = schema; this.services = services; - this.validator = this.createValidator(schema); + this.createValidator(schema); } /** @@ -36,7 +36,7 @@ class GenericProtocol { * @returns {Validator} */ createValidator(schema) { - return new Validator(schema); + this.validator = new Validator(schema); } /** @@ -116,12 +116,12 @@ class GenericSoarProtocol extends GenericProtocol { */ createValidator(schema) { if (typeof schema === 'string' && schema.match(/^[\w\.]+$/)) { - return this.loadSchema(schema) + this.loadSchema(schema) .then((schema) => { - return new Validator(schema); + this.validator = new Validator(schema); }); } else { - return new Validator(schema); + this.validator = new Validator(schema); } } diff --git a/dist/protocol.js b/dist/protocol.js index e91ec20c17f62b8cb928b86427aea156f5349f9f..d58f9949777d090e670597079613ddddd8ab286b 100644 --- a/dist/protocol.js +++ b/dist/protocol.js @@ -29,7 +29,7 @@ class GenericProtocol { constructor(schema, services) { this.schema = schema; this.services = services; - this.validator = this.createValidator(schema); + this.createValidator(schema); } /** @@ -38,7 +38,7 @@ class GenericProtocol { * @returns {Validator} */ createValidator(schema) { - return new Validator(schema); + this.validator = new Validator(schema); } /** @@ -118,12 +118,12 @@ class GenericSoarProtocol extends GenericProtocol { */ createValidator(schema) { if (typeof schema === 'string' && schema.match(/^[\w\.]+$/)) { - return this.loadSchema(schema) + this.loadSchema(schema) .then((schema) => { - return new Validator(schema); + this.validator = new Validator(schema); }); } else { - return new Validator(schema); + this.validator = new Validator(schema); } } diff --git a/src/protocol/index.js b/src/protocol/index.js index 5f65b225efd91e4b1e260f857366149b44aef7a8..2ed8019f2f990644859f0e0d02bc70a6d125bca9 100644 --- a/src/protocol/index.js +++ b/src/protocol/index.js @@ -27,7 +27,7 @@ export class GenericProtocol { constructor(schema, services) { this.schema = schema; this.services = services; - this.validator = this.createValidator(schema); + this.createValidator(schema); } /** @@ -36,7 +36,7 @@ export class GenericProtocol { * @returns {Validator} */ createValidator(schema) { - return new Validator(schema); + this.validator = new Validator(schema); } /** @@ -116,12 +116,12 @@ export class GenericSoarProtocol extends GenericProtocol { */ createValidator(schema) { if (typeof schema === 'string' && schema.match(/^[\w\.]+$/)) { - return this.loadSchema(schema) + this.loadSchema(schema) .then((schema) => { - return new Validator(schema); + this.validator = new Validator(schema); }); } else { - return new Validator(schema); + this.validator = new Validator(schema); } }