Skip to content

Commit

Permalink
Merge pull request #161 from Sebastian-Webster/160-not-quite-valid-se…
Browse files Browse the repository at this point in the history
…mver-strings-fail-value-checks-for-version-option

Fix not quite valid semver strings not being able to be used for the MySQL DB version
  • Loading branch information
Sebastian-Webster authored Dec 3, 2024
2 parents 09ca65b + 28fba21 commit 1015386
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InternalServerOptions, OptionTypeChecks } from "../types";
import { randomUUID } from "crypto";
import {normalize as normalizePath} from 'path'
import { tmpdir } from "os";
import { valid as validSemver } from "semver";
import { valid as validSemver, coerce as coerceSemver } from "semver";

export const MIN_SUPPORTED_MYSQL = '8.0.20';

Expand Down Expand Up @@ -41,7 +41,7 @@ export const INTERNAL_OPTIONS = ['_DO_NOT_USE_deleteDBAfterStopped', '_DO_NOT_US
const allowedArches = ['x64', 'arm64', undefined]
export const OPTION_TYPE_CHECKS: OptionTypeChecks = {
version: {
check: (opt: any) => opt === undefined || typeof opt === 'string' && validSemver(opt) !== null,
check: (opt: any) => opt === undefined || typeof opt === 'string' && validSemver(coerceSemver(opt)) !== null,
errorMessage: 'Option version must be either undefined or a valid semver string.',
definedType: 'string'
},
Expand Down

0 comments on commit 1015386

Please sign in to comment.