Fix npm run check (#723)

* fix npm run check errors

* undo changes in style_switcher
This commit is contained in:
slothful-vassal
2026-01-13 20:25:40 +01:00
committed by GitHub
parent c2b86f5521
commit 4b749c9868
6 changed files with 26 additions and 15 deletions

View File

@@ -95,7 +95,11 @@ const auth: Handle = async ({ event, resolve }) => {
meiliApiKey = publicMeilisearchKey!;
}
const ms = new MeiliSearch({ host: env.MEILI_URL, apiKey: meiliApiKey });
const meiliHost = env.MEILI_URL;
if (!meiliHost) {
throw error(500, "Missing MEILI_URL");
}
const ms = new MeiliSearch({ host: meiliHost, apiKey: meiliApiKey });
event.locals.ms = ms
event.locals.pb = pb

View File

@@ -268,23 +268,23 @@ export function createOverpassPopup(feature: GeoJSON.Feature, coordinates: GeoJS
popupContainer.className = "p-4"
const popupHeading = document.createElement("h1");
popupHeading.classList = "font-medium text-lg"
popupHeading.className = "font-medium text-lg"
popupHeading.textContent = name;
const coordinateSubtitle = document.createElement("p")
coordinateSubtitle.classList = "text-gray-500"
coordinateSubtitle.className = "text-gray-500"
coordinateSubtitle.textContent = `${coordinates[0].toFixed(6)}, ${coordinates[1].toFixed(6)}`
popupContainer.appendChild(popupHeading)
popupContainer.appendChild(coordinateSubtitle)
const tagsGrid = document.createElement("div")
tagsGrid.classList = "grid grid-cols-2 gap-x-4 mt-4"
tagsGrid.className = "grid grid-cols-2 gap-x-4 mt-4"
Object.entries(tags).forEach((([k, v]) => {
if (k == "name") return;
const kSpan = document.createElement("span")
kSpan.classList = "font-mono"
kSpan.className = "font-mono"
kSpan.textContent = k;
const vSpan = document.createElement("span")
vSpan.textContent = v;

View File

@@ -41,12 +41,14 @@ function formatByType(data: number, type: string | number, scale: number, offset
case 'uint32':
case 'uint16':
return scale ? data / scale + offset : data;
default:
if (FIT.types[type]) {
return FIT.types[type][data];
default: {
const types = FIT.types as Record<string, Record<string, any>>;
if (types[type]) {
return types[type][String(data)];
}
return data;
}
}
}
function isInvalidValue(data: number, type: string) {
@@ -91,7 +93,8 @@ function isInvalidValue(data: number, type: string) {
}
function convertTo(data: number, unitsList: string, speedUnit: string | number) {
var unitObj = FIT.options[unitsList][speedUnit];
const options = FIT.options as Record<string, Record<string, { multiplier: number; offset: number }>>;
var unitObj = options[unitsList]?.[String(speedUnit)];
return unitObj ? data * unitObj.multiplier + unitObj.offset : data;
}

View File

@@ -77,7 +77,7 @@ class EasyFit {
}
}
var fitObj = {};
var fitObj: Record<string, any> = {};
var sessions = [];
var laps = [];
var records = [];
@@ -98,7 +98,7 @@ class EasyFit {
var _readRecord = readRecord(blob, messageTypes, loopIndex, this.options, startDate),
nextIndex = _readRecord.nextIndex,
messageType = _readRecord.messageType,
message = _readRecord.message;
message = "message" in _readRecord ? _readRecord.message : undefined;
loopIndex = nextIndex;
switch (messageType) {

View File

@@ -2427,11 +2427,14 @@ function getMessageName(messageNum: keyof typeof FIT.messages) {
return message ? message.name : '';
}
function getFieldObject(fieldNum: keyof typeof FIT.messages[keyof typeof FIT.messages], messageNum: keyof typeof FIT.messages) {
function getFieldObject(fieldNum: keyof typeof FIT.messages[keyof typeof FIT.messages], messageNum: keyof typeof FIT.messages): Record<string, any> {
var message = FIT.messages[messageNum];
if (!message) {
return '';
return {};
}
var fieldObj = message[fieldNum];
return fieldObj ? fieldObj : {};
if (fieldObj && typeof fieldObj === "object") {
return fieldObj as Record<string, any>;
}
return {};
}

View File

@@ -86,6 +86,7 @@
clientSecret: integration.strava.clientSecret,
routes: integration.strava.routes,
activities: integration.strava.activities,
privacy: integration.strava.privacy,
accessToken: undefined,
refreshToken: undefined,
expiresAt: undefined,