Socket
Socket
Sign inDemoInstall

geo-coordinates-parser

Package Overview
Dependencies
0
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.6.5 to 1.6.6

14

dist/cjs/converter.d.ts

@@ -5,9 +5,17 @@ export default converter;

* @param {string} coordsString The coordinates string to convert
* @param {number} decimalPlaces The number of decimal places for converted coordinates; default is 5
* @returns {object} { verbatimCoordinates, decimalCoordinates, decimalLatitude, decimalLongitude }
* @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
* @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
*/
declare function converter(coordsString: string, decimalPlaces: number): object;
declare function converter(coordsString: string, decimalPlaces?: number | undefined): {
verbatimCoordinates: string;
decimalCoordinates: string;
decimalLatitude: string;
decimalLongitude: string;
closeEnough: (arg0: string) => boolean;
toCoordinateFormat: typeof toCoordinateFormat;
};
declare namespace converter {
export { to };
}
import toCoordinateFormat from './toCoordinateFormat.js';
declare const to: Readonly<{

@@ -14,0 +22,0 @@ DMS: "DMS";

@@ -13,4 +13,4 @@ "use strict";

* @param {string} coordsString The coordinates string to convert
* @param {number} decimalPlaces The number of decimal places for converted coordinates; default is 5
* @returns {object} { verbatimCoordinates, decimalCoordinates, decimalLatitude, decimalLongitude }
* @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
* @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
*/

@@ -17,0 +17,0 @@ function converter(coordsString, decimalPlaces) {

@@ -9,3 +9,3 @@ "use strict";

//const test = '00.00, 01.00'
const test = `8°83S 35°67E`;
const test = `26°05240'S, 27°51448'E`;
try {

@@ -12,0 +12,0 @@ let converted = (0, converter_js_1.default)(test);

export default toCoordinateFormat;
/**
* Converts decimalCoordinates to other formats commonly used
* @param {*} format Either DMS or DM
* @param {string} format Either DMS or DM
* @returns {string}
*/
declare function toCoordinateFormat(format: any): any;
declare function toCoordinateFormat(format: string): string;

@@ -6,3 +6,4 @@ "use strict";

* Converts decimalCoordinates to other formats commonly used
* @param {*} format Either DMS or DM
* @param {string} format Either DMS or DM
* @returns {string}
*/

@@ -9,0 +10,0 @@ function toCoordinateFormat(format) {

@@ -5,9 +5,17 @@ export default converter;

* @param {string} coordsString The coordinates string to convert
* @param {number} decimalPlaces The number of decimal places for converted coordinates; default is 5
* @returns {object} { verbatimCoordinates, decimalCoordinates, decimalLatitude, decimalLongitude }
* @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
* @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
*/
declare function converter(coordsString: string, decimalPlaces: number): object;
declare function converter(coordsString: string, decimalPlaces?: number | undefined): {
verbatimCoordinates: string;
decimalCoordinates: string;
decimalLatitude: string;
decimalLongitude: string;
closeEnough: (arg0: string) => boolean;
toCoordinateFormat: typeof toCoordinateFormat;
};
declare namespace converter {
export { to };
}
import toCoordinateFormat from './toCoordinateFormat.js';
declare const to: Readonly<{

@@ -14,0 +22,0 @@ DMS: "DMS";

@@ -8,4 +8,4 @@ //function for converting coordinates from a string to decimal and verbatim

* @param {string} coordsString The coordinates string to convert
* @param {number} decimalPlaces The number of decimal places for converted coordinates; default is 5
* @returns {object} { verbatimCoordinates, decimalCoordinates, decimalLatitude, decimalLongitude }
* @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
* @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
*/

@@ -12,0 +12,0 @@ function converter(coordsString, decimalPlaces) {

import convert from '../converter.js';
//const test = '26°44S 29°46E'
//const test = '00.00, 01.00'
const test = `8°83S 35°67E`;
const test = `26°05240'S, 27°51448'E`;
try {

@@ -6,0 +6,0 @@ let converted = convert(test);

export default toCoordinateFormat;
/**
* Converts decimalCoordinates to other formats commonly used
* @param {*} format Either DMS or DM
* @param {string} format Either DMS or DM
* @returns {string}
*/
declare function toCoordinateFormat(format: any): any;
declare function toCoordinateFormat(format: string): string;
//borrowed from https://www.codegrepper.com/code-examples/javascript/javascript+converting+latitude+longitude+to+gps+coordinates
/**
* Converts decimalCoordinates to other formats commonly used
* @param {*} format Either DMS or DM
* @param {string} format Either DMS or DM
* @returns {string}
*/

@@ -6,0 +7,0 @@ function toCoordinateFormat(format) {

{
"name": "geo-coordinates-parser",
"version": "1.6.5",
"version": "1.6.6",
"description": "A Javascript function for reading a variety of coordinate formats and converting to decimal numbers. Builds on other efforts by returning the verbatim coordinates and the decimal coordinates all in one object.",

@@ -5,0 +5,0 @@ "type": "module",

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc