From 6e06aac1e9e4dd0b8eeff2ef0ba6869243f832b8 Mon Sep 17 00:00:00 2001 From: Dan Jones <danjon@noc.ac.uk> Date: Fri, 30 Aug 2024 13:35:24 +0100 Subject: [PATCH] fix: add hyphen to schema version regex - Current regex works for dev, master and semvers - It doesn't work for issue branches --- CHANGELOG.md | 4 ++++ src/protocol/index.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee493a3..042f643 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- Add hyphen to regex for schema version to enable issue branches + ## [v0.1.0] - 2023-03-24 ### Added diff --git a/src/protocol/index.js b/src/protocol/index.js index e1f35d3..0dc039b 100644 --- a/src/protocol/index.js +++ b/src/protocol/index.js @@ -125,7 +125,7 @@ export class GenericSoarProtocol extends GenericProtocol { * @returns {object} */ createValidator(schema) { - if (typeof schema === 'string' && schema.match(/^[\w.]+$/)) { + if (typeof schema === 'string' && schema.match(/^[\w.-]+$/)) { this.loadSchema(schema).then((schema) => { this.validator = new Validator(schema); }); -- GitLab