geo-coordinates-parser 1.7.3 → 1.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,13 +3,13 @@ export default converter;
3
3
  * Function for converting coordinates in a variety of formats to decimal coordinates
4
4
  * @param {string} coordsString The coordinates string to convert
5
5
  * @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
6
- * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
6
+ * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: number, decimalLongitude: number, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
7
7
  */
8
8
  declare function converter(coordsString: string, decimalPlaces?: number | undefined): {
9
9
  verbatimCoordinates: string;
10
10
  decimalCoordinates: string;
11
- decimalLatitude: string;
12
- decimalLongitude: string;
11
+ decimalLatitude: number;
12
+ decimalLongitude: number;
13
13
  closeEnough: (arg0: string) => boolean;
14
14
  toCoordinateFormat: typeof toCoordinateFormat;
15
15
  };
@@ -11,7 +11,7 @@ const toCoordinateFormat_js_1 = __importDefault(require("./toCoordinateFormat.js
11
11
  * Function for converting coordinates in a variety of formats to decimal coordinates
12
12
  * @param {string} coordsString The coordinates string to convert
13
13
  * @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
14
- * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
14
+ * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: number, decimalLongitude: number, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
15
15
  */
16
16
  function converter(coordsString, decimalPlaces) {
17
17
  //TODO add exact match to entered string, so that it can be used to filter out superflous text around it
@@ -11,8 +11,9 @@ const converter_js_1 = __importDefault(require("../converter.js"));
11
11
  //const test = `8°83S 35°67E`
12
12
  //const test = `N 48° 30,6410', E 18° 57,4583'`
13
13
  //const test = '-254.4602, 31.53681'
14
- const test = '25.62S, 27.77E';
15
- //const correctDecimals = '-25.533333, 27.283333'
14
+ //const test = '25.62S, 27.77E'
15
+ const test = '26°44S 29°46E';
16
+ const correctDecimals = '-26.73333, 29.76666';
16
17
  let converted;
17
18
  try {
18
19
  converted = (0, converter_js_1.default)(test);
@@ -3,13 +3,13 @@ export default converter;
3
3
  * Function for converting coordinates in a variety of formats to decimal coordinates
4
4
  * @param {string} coordsString The coordinates string to convert
5
5
  * @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
6
- * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
6
+ * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: number, decimalLongitude: number, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
7
7
  */
8
8
  declare function converter(coordsString: string, decimalPlaces?: number | undefined): {
9
9
  verbatimCoordinates: string;
10
10
  decimalCoordinates: string;
11
- decimalLatitude: string;
12
- decimalLongitude: string;
11
+ decimalLatitude: number;
12
+ decimalLongitude: number;
13
13
  closeEnough: (arg0: string) => boolean;
14
14
  toCoordinateFormat: typeof toCoordinateFormat;
15
15
  };
@@ -6,7 +6,7 @@ import toCoordinateFormat from './toCoordinateFormat.js';
6
6
  * Function for converting coordinates in a variety of formats to decimal coordinates
7
7
  * @param {string} coordsString The coordinates string to convert
8
8
  * @param {number} [decimalPlaces] The number of decimal places for converted coordinates; default is 5
9
- * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: string, decimalLongitude: string, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
9
+ * @returns {{verbatimCoordinates: string, decimalCoordinates: string, decimalLatitude: number, decimalLongitude: number, closeEnough: function(string): boolean, toCoordinateFormat: toCoordinateFormat}}
10
10
  */
11
11
  function converter(coordsString, decimalPlaces) {
12
12
  //TODO add exact match to entered string, so that it can be used to filter out superflous text around it
@@ -6,8 +6,9 @@ import convert from '../converter.js';
6
6
  //const test = `8°83S 35°67E`
7
7
  //const test = `N 48° 30,6410', E 18° 57,4583'`
8
8
  //const test = '-254.4602, 31.53681'
9
- const test = '25.62S, 27.77E';
10
- //const correctDecimals = '-25.533333, 27.283333'
9
+ //const test = '25.62S, 27.77E'
10
+ const test = '26°44S 29°46E';
11
+ const correctDecimals = '-26.73333, 29.76666';
11
12
  let converted;
12
13
  try {
13
14
  converted = convert(test);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geo-coordinates-parser",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "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
5
  "type": "module",
6
6
  "main": "./dist/cjs/merge.js",