Skip to content

Commit

Permalink
Merge pull request #1747 from jdesrosiers/fix-hyperjump-harness
Browse files Browse the repository at this point in the history
Fix bug in hyperjump harness
  • Loading branch information
Julian authored Jan 1, 2025
2 parents 505a87a + 5fe147b commit 8d8e507
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions implementations/js-hyperjump/bowtie_hyperjump.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import readline from "readline/promises";
import os from "os";
import process from "process";
import { createRequire } from "node:module";
import * as semver from "semver";
const packageJson = createRequire(import.meta.url)(
"./node_modules/@hyperjump/json-schema/package.json",
);
Expand All @@ -14,7 +15,7 @@ var unregisterSchema;
var getRetrievalURI;

await (async () => {
if (hyperjump_version >= "1.7.0") {
if (semver.satisfies(hyperjump_version, ">=1.7.0")) {
await Promise.all([
import("@hyperjump/json-schema/draft-2019-09"),
import("@hyperjump/json-schema/draft-07"),
Expand All @@ -40,7 +41,7 @@ await (async () => {
getRetrievalURI = (_, __, args) =>
`https://example.com/bowtie-sent-schema-${args.seq.toString()}`;
} else {
if (hyperjump_version >= "1.0.0") {
if (semver.satisfies(hyperjump_version, ">=1.0.0")) {
await Promise.all([
import("@hyperjump/json-schema/draft-2019-09"),
import("@hyperjump/json-schema/draft-07"),
Expand All @@ -60,7 +61,7 @@ await (async () => {

return await JsonSchema.validate(retrievalURI);
};
} else if (hyperjump_version >= "0.18.0") {
} else if (semver.satisfies(hyperjump_version, ">=0.18.0")) {
const JsonSchema = await import("@hyperjump/json-schema");

registerSchemaAndValidate = async (testCase, dialect, retrievalURI) => {
Expand Down
3 changes: 2 additions & 1 deletion implementations/js-hyperjump/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.0.0",
"type": "module",
"dependencies": {
"@hyperjump/json-schema": "^1.0.0"
"@hyperjump/json-schema": "^1.0.0",
"semver": "^7.6.3"
}
}

0 comments on commit 8d8e507

Please sign in to comment.