From 8ad9f7d79bc5ac81ba88a70c911f4ebb470aee82 Mon Sep 17 00:00:00 2001 From: Dan Jones <dan.jones@noc.ac.uk> Date: Thu, 23 Feb 2023 09:12:29 +0000 Subject: [PATCH] fix: remove await in schema loading --- dist/protocol.esm.js | 5 ++--- dist/protocol.js | 5 ++--- src/protocol/index.js | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dist/protocol.esm.js b/dist/protocol.esm.js index 0a78d88..0132583 100644 --- a/dist/protocol.esm.js +++ b/dist/protocol.esm.js @@ -114,9 +114,9 @@ class GenericSoarProtocol extends GenericProtocol { * @param {string|object} schema * @returns {object} */ - async createValidator(schema) { + createValidator(schema) { if (typeof schema === 'string' && schema.match(/^[\w\.]+$/)) { - return await this.loadSchema(schema) + return this.loadSchema(schema) .then((schema) => { return new Validator(schema); }); @@ -125,7 +125,6 @@ class GenericSoarProtocol extends GenericProtocol { } } - /** * Load schema from gitlab by tag/branch/commitref * @param {string} version diff --git a/dist/protocol.js b/dist/protocol.js index 3146ab0..d75a073 100644 --- a/dist/protocol.js +++ b/dist/protocol.js @@ -116,9 +116,9 @@ class GenericSoarProtocol extends GenericProtocol { * @param {string|object} schema * @returns {object} */ - async createValidator(schema) { + createValidator(schema) { if (typeof schema === 'string' && schema.match(/^[\w\.]+$/)) { - return await this.loadSchema(schema) + return this.loadSchema(schema) .then((schema) => { return new Validator(schema); }); @@ -127,7 +127,6 @@ class GenericSoarProtocol extends GenericProtocol { } } - /** * Load schema from gitlab by tag/branch/commitref * @param {string} version diff --git a/src/protocol/index.js b/src/protocol/index.js index 1c55f2a..ad7d386 100644 --- a/src/protocol/index.js +++ b/src/protocol/index.js @@ -114,9 +114,9 @@ export class GenericSoarProtocol extends GenericProtocol { * @param {string|object} schema * @returns {object} */ - async createValidator(schema) { + createValidator(schema) { if (typeof schema === 'string' && schema.match(/^[\w\.]+$/)) { - return await this.loadSchema(schema) + return this.loadSchema(schema) .then((schema) => { return new Validator(schema); }); -- GitLab