Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

docs: clarify coordinate and package boundary helpers

HoshinoSuzumiBotdc66f76710ef
diff --git a/packages/contracts/src/location.ts b/packages/contracts/src/location.ts
index 5343f5b2..16f45030 100644
--- a/packages/contracts/src/location.ts
+++ b/packages/contracts/src/location.ts
@@ -24,6 +24,7 @@ export interface NormalizedLocation {
formattedAddress?: string
}
+/** Accept finite, in-range coordinates while excluding the legacy Null Island placeholder. */
export function hasValidCoordinates(lat: unknown, lon: unknown): boolean {
return (
typeof lat === 'number' &&
diff --git a/packages/geocoding/src/normalize.ts b/packages/geocoding/src/normalize.ts
index 7d5f8b53..859a7421 100644
--- a/packages/geocoding/src/normalize.ts
+++ b/packages/geocoding/src/normalize.ts
@@ -9,6 +9,7 @@ const name = (value: unknown): string | undefined =>
const municipalityCodes = new Set(['CN-BJ', 'CN-TJ', 'CN-SH', 'CN-CQ'])
+/** Reuse the regional component as the city for explicitly identified Chinese municipalities. */
function applyMunicipality(result: NormalizedLocation, code: unknown) {
// A direct-administered municipality also acts as the city. Use the explicit
// ISO subdivision code, rather than guessing from translated name suffixes.
@@ -22,6 +23,7 @@ function applyMunicipality(result: NormalizedLocation, code: unknown) {
}
}
+/** Keep the first nonempty name for a location level and record its provider source field. */
function put(
result: NormalizedLocation,
level: LocationLevel,
diff --git a/packages/geocoding/src/rate-limit.ts b/packages/geocoding/src/rate-limit.ts
index a74410c3..020ac34c 100644
--- a/packages/geocoding/src/rate-limit.ts
+++ b/packages/geocoding/src/rate-limit.ts
@@ -6,6 +6,7 @@ export function createGeocodingRateLimiter() {
// Reserve synchronously before waiting so separate providers/workers cannot
// start together after the same delay. Providers are recreated for each photo.
+ /** Reserve the next endpoint slot before waiting; abort signals cancel the wait. */
async function waitForGeocodingSlot(
key: string,
intervalMs: number,
diff --git a/scripts/check-package-boundaries.mjs b/scripts/check-package-boundaries.mjs
index 3dfdf69b..6f7e631c 100644
--- a/scripts/check-package-boundaries.mjs
+++ b/scripts/check-package-boundaries.mjs
@@ -9,6 +9,7 @@ const builtins = new Set(
)
const failures = []
+/** Recursively collect TypeScript source paths for static package dependency checks. */
async function files(directory) {
const entries = await readdir(directory, { withFileTypes: true })
return (