mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-29 08:28:40 +00:00
chore: improve typescript typings
This commit is contained in:
parent
8bc3bd5021
commit
7d2fe05af9
@ -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);
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user