mirror of
https://github.com/pockethost/pockethost.git
synced 2025-11-29 00:23:05 +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 records = dao.findRecordsByFilter(`instances`, "1=1").filter((r) => !!r);
|
||||||
const unrecognized = [];
|
const unrecognized = [];
|
||||||
records.forEach((record) => {
|
records.forEach((record) => {
|
||||||
const v = record.get("version").trim();
|
const v = record.getString("version").trim();
|
||||||
if (versions.includes(v)) return;
|
if (versions.includes(v)) return;
|
||||||
const newVersion = (() => {
|
const newVersion = (() => {
|
||||||
if (v.startsWith(`~`)) {
|
if (v.startsWith(`~`)) {
|
||||||
@ -296,6 +296,7 @@ var HandleMigrateInstanceVersions = (e) => {
|
|||||||
return versions[0];
|
return versions[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return v;
|
||||||
})();
|
})();
|
||||||
if (versions.includes(newVersion)) {
|
if (versions.includes(newVersion)) {
|
||||||
record.set(`version`, 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 records = dao.findRecordsByFilter(`instances`, '1=1').filter((r) => !!r)
|
||||||
const unrecognized: string[] = []
|
const unrecognized: string[] = []
|
||||||
records.forEach((record) => {
|
records.forEach((record) => {
|
||||||
const v = record.get('version').trim()
|
const v = record.getString('version').trim()
|
||||||
if (versions.includes(v)) return
|
if (versions.includes(v)) return
|
||||||
const newVersion = (() => {
|
const newVersion = (() => {
|
||||||
if (v.startsWith(`~`)) {
|
if (v.startsWith(`~`)) {
|
||||||
@ -18,9 +18,10 @@ export const HandleMigrateInstanceVersions = (e: core.BootstrapEvent) => {
|
|||||||
return newVersion
|
return newVersion
|
||||||
} else {
|
} else {
|
||||||
if (v === `^0` || v === `0` || v === '1') {
|
if (v === `^0` || v === `0` || v === '1') {
|
||||||
return versions[0]
|
return versions[0]!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return v
|
||||||
})()
|
})()
|
||||||
if (versions.includes(newVersion)) {
|
if (versions.includes(newVersion)) {
|
||||||
record.set(`version`, newVersion)
|
record.set(`version`, newVersion)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user