web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

gcs.ts (474B)


      1 import type { GcsLocation } from "@radroots/replica-db-schema-bindings";
      2 import type { LocationBasis } from "./types.js";
      3 
      4 export const gcs_to_location_basis = ({
      5     id,
      6     lat,
      7     lng,
      8     gc_name: primary,
      9     gc_admin1_name: admin,
     10     gc_country_id: country,
     11 }: GcsLocation): LocationBasis => ({
     12     id,
     13     point: {
     14         lat,
     15         lng,
     16     },
     17     address: primary && admin && country ? {
     18         primary,
     19         admin,
     20         country,
     21     } : undefined,
     22 });