Socket
Socket
Sign inDemoInstall

@cobuildlab/american-arbor-shared

Package Overview
Dependencies
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cobuildlab/american-arbor-shared


Version published
Weekly downloads
4
decreased by-94.12%
Maintainers
4
Weekly downloads
 
Created
Source

test

Documentation for the provided code:

Types:

  • GeoJsonPoint:

    • Represents a GeoJSON point.
    • Extends the GeoJsonGeometryInterface and GeoJsonInterface interfaces.
    • Properties:
      • __typename?: 'GeoJSONPoint' (optional)
      • bbox?: Maybe<Array<Maybe<Scalars['Float']>>> (optional, bounding box)
      • coordinates?: Maybe<Scalars['GeoJSONCoordinates']> (optional, coordinates)
      • type: GeoJsonType (geometry type, always 'Point' for this type)
  • GetLocationFromGeoJSONPointReturnType:

    • Return type of the getLocationFromGeoJSONPoint function.
    • Properties:
      • latitude: number (latitude)
      • longitude: number (longitude)

Functions:

  • getLocationFromGeoJSONPoint(data):
    • Extracts the latitude and longitude from a GeoJSON point.
    • Parameters:
      • data: A partial GeoJsonPoint object or null/undefined.
    • Returns:
      • A GetLocationFromGeoJSONPointReturnType object with latitude and longitude if the data is valid, otherwise undefined.

Example usage:

const geojsonPoint = {
  type: "Point",
  coordinates: [-74.0060, 40.7128],
};

const location = getLocationFromGeoJSONPoint(geojsonPoint);

if (location) {
  console.log(f"Latitude: {location.latitude}, Longitude: {location.longitude}");
} else {
  console.log("Invalid GeoJSON point.");
}

Keywords

FAQs

Package last updated on 22 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc