mirror of
https://github.com/ccmdi/obsidian-map-plus.git
synced 2026-07-22 06:43:14 +00:00
chore: eslint
This commit is contained in:
parent
c85125cdb4
commit
d491fe0171
3 changed files with 4 additions and 3 deletions
|
|
@ -20,6 +20,7 @@ export interface MapPoint {
|
|||
polygon?: LatLng.Verified[];
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
export namespace MapPoint {
|
||||
export function areSamePlace(point1: MapPoint, point2: MapPoint): boolean {
|
||||
return point1.location.lat === point2.location.lat && point1.location.lng === point2.location.lng;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
export namespace LatLng {
|
||||
// Unverified input - accepts various formats
|
||||
export type Like =
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import {
|
|||
BasesPropertyId,
|
||||
BasesView,
|
||||
ListValue,
|
||||
NumberValue,
|
||||
QueryController,
|
||||
StringValue,
|
||||
ViewOption,
|
||||
|
|
@ -460,7 +459,7 @@ export class MapBasesView extends BasesView {
|
|||
const latValue = extractFromFrontmatter(fileCache.frontmatter, this.plugin.settings.latKey);
|
||||
const lngValue = extractFromFrontmatter(fileCache.frontmatter, this.plugin.settings.lngKey);
|
||||
|
||||
return LatLng.parse(`${latValue}, ${lngValue}`);
|
||||
return LatLng.parse([latValue, lngValue]);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Error extracting coordinates from frontmatter for ${entry.file.name}:`, error);
|
||||
|
|
@ -482,7 +481,7 @@ export class MapBasesView extends BasesView {
|
|||
}
|
||||
// Handle string value as JSON array
|
||||
else if (value instanceof StringValue) {
|
||||
const parsed = JSON.parse(value.toString().trim());
|
||||
const parsed = JSON.parse(value.toString().trim()) as unknown[];
|
||||
if (Array.isArray(parsed)) {
|
||||
items = parsed;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue