Update civitai_helper.js

Modified regular expression for version to use numeric values, not single character numbers - allowing for versions like "10" not just single characters, fixing compatibility with version 1.10.0.
pull/299/head
Scott Moore 2024-08-04 13:14:41 -07:00 committed by GitHub
parent b628255661
commit 98ff5cc2cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -34,9 +34,9 @@ function extract_version(text) {
let matches; let matches;
// for forge // for forge
if (text[0] == 'f') if (text[0] == 'f')
matches = text.match(/v[0-9]\.[0-9]\.[0-9]/); matches = text.match(/v\d+\.\d+\.\d+/);
else else
matches = text.match(/[0-9]\.[0-9]\.[0-9]/); matches = text.match(/\d+\.\d+\.\d+/);
if (matches === null || matches.length == 0) { if (matches === null || matches.length == 0) {
return null; return null;