chore: improve typescript typings

This commit is contained in:
Ben Allfree 2024-12-04 02:41:59 -08:00
parent 8bc3bd5021
commit 7d2fe05af9
2 changed files with 5 additions and 3 deletions

View File

@ -284,7 +284,7 @@ var HandleMigrateInstanceVersions = (e) => {
const records = dao.findRecordsByFilter(`instances`, "1=1").filter((r) => !!r);
const unrecognized = [];
records.forEach((record) => {
const v = record.get("version").trim();
const v = record.getString("version").trim();
if (versions.includes(v)) return;
const newVersion = (() => {
if (v.startsWith(`~`)) {
@ -296,6 +296,7 @@ var HandleMigrateInstanceVersions = (e) => {
return versions[0];
}
}
return v;
})();
if (versions.includes(newVersion)) {
record.set(`version`, newVersion);

View File

@ -9,7 +9,7 @@ export const HandleMigrateInstanceVersions = (e: core.BootstrapEvent) => {
const records = dao.findRecordsByFilter(`instances`, '1=1').filter((r) => !!r)
const unrecognized: string[] = []
records.forEach((record) => {
const v = record.get('version').trim()
const v = record.getString('version').trim()
if (versions.includes(v)) return
const newVersion = (() => {
if (v.startsWith(`~`)) {
@ -18,9 +18,10 @@ export const HandleMigrateInstanceVersions = (e: core.BootstrapEvent) => {
return newVersion
} else {
if (v === `^0` || v === `0` || v === '1') {
return versions[0]
return versions[0]!
}
}
return v
})()
if (versions.includes(newVersion)) {
record.set(`version`, newVersion)