Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@mapbox/geojson-types
Advanced tools
Flow type declarations for [GeoJSON](https://tools.ietf.org/html/rfc7946).
@mapbox/geojson-types is a TypeScript library that provides type definitions for GeoJSON objects. It helps developers ensure that their GeoJSON data adheres to the correct structure and types, making it easier to work with GeoJSON data in a type-safe manner.
Point
Defines a GeoJSON Point object with specific coordinates.
const point: GeoJSON.Point = { type: 'Point', coordinates: [100.0, 0.0] };
LineString
Defines a GeoJSON LineString object with an array of coordinate pairs.
const lineString: GeoJSON.LineString = { type: 'LineString', coordinates: [[100.0, 0.0], [101.0, 1.0]] };
Polygon
Defines a GeoJSON Polygon object with an array of linear rings.
const polygon: GeoJSON.Polygon = { type: 'Polygon', coordinates: [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]] };
Feature
Defines a GeoJSON Feature object that includes a geometry and properties.
const feature: GeoJSON.Feature<GeoJSON.Point> = { type: 'Feature', geometry: { type: 'Point', coordinates: [100.0, 0.0] }, properties: { name: 'Sample Point' } };
FeatureCollection
Defines a GeoJSON FeatureCollection object that includes an array of features.
const featureCollection: GeoJSON.FeatureCollection<GeoJSON.Geometry> = { type: 'FeatureCollection', features: [{ type: 'Feature', geometry: { type: 'Point', coordinates: [100.0, 0.0] }, properties: { name: 'Sample Point' } }] };
The 'geojson' package provides utilities for creating and manipulating GeoJSON data. It offers a more comprehensive set of tools for working with GeoJSON, including validation and transformation functions, compared to @mapbox/geojson-types which focuses on type definitions.
The 'geojson-utils' package offers a set of utility functions for working with GeoJSON data, such as calculating distances and bounding boxes. It provides more functional utilities for GeoJSON data manipulation, whereas @mapbox/geojson-types is primarily concerned with type safety.
The 'terraformer' package is a library for working with GeoJSON and other geographic data formats. It includes tools for parsing, converting, and manipulating GeoJSON data. Terraformer offers a broader range of functionalities compared to @mapbox/geojson-types, which is focused on type definitions.
Flow type declarations for GeoJSON.
npm install @mapbox/geojson-types
// @flow
import type {
GeoJSONFeatureCollection,
GeoJSONFeature,
// specific geometries
GeoJSONPoint,
GeoJSONLineString,
GeoJSONPolygon,
GeoJSONMultiPoint,
GeoJSONMultiLineString,
GeoJSONMultiPolygon,
// any geometry
GeoJSONGeometry,
// any feature collection, feature, or geometry
GeoJSON,
} from '@mapbox/geojson-types';
function doSomething(data: GeoJSON) {
// ...
}
FAQs
Flow type declarations for [GeoJSON](https://tools.ietf.org/html/rfc7946).
We found that @mapbox/geojson-types demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.