mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Add ESLint + pre-commit hook and fix the issues it surfaced
This commit is contained in:
@@ -19,9 +19,7 @@ export interface FormatDetection {
|
||||
|
||||
function isTopology(value: unknown): boolean {
|
||||
return (
|
||||
typeof value === 'object' &&
|
||||
value !== null &&
|
||||
(value as { type?: unknown }).type === 'Topology'
|
||||
typeof value === 'object' && value !== null && (value as { type?: unknown }).type === 'Topology'
|
||||
);
|
||||
}
|
||||
|
||||
@@ -32,7 +30,7 @@ export function detectFormat(raw: string): FormatDetection {
|
||||
|
||||
// 1. Try JSON first — highest confidence signal.
|
||||
try {
|
||||
const parsed = JSON.parse(text);
|
||||
const parsed: unknown = JSON.parse(text);
|
||||
return {
|
||||
format: isTopology(parsed) ? 'topojson' : 'json',
|
||||
confidence: 'high',
|
||||
|
||||
Reference in New Issue
Block a user