Fix npm run check (#723)
* fix npm run check errors * undo changes in style_switcher
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
11
web/src/lib/vendor/easy-fit/binary.ts
vendored
11
web/src/lib/vendor/easy-fit/binary.ts
vendored
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
4
web/src/lib/vendor/easy-fit/easy-fit.ts
vendored
4
web/src/lib/vendor/easy-fit/easy-fit.ts
vendored
@@ -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) {
|
||||
|
||||
9
web/src/lib/vendor/easy-fit/fit.ts
vendored
9
web/src/lib/vendor/easy-fit/fit.ts
vendored
@@ -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 {};
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user