@react-fabric/utilities 1.0.0-beta.52 → 1.0.0-beta.58
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.
- package/dist/cjs/_lonlat.js +16 -4
- package/dist/cjs/index.js +1 -0
- package/dist/esm/_lonlat.js +16 -5
- package/dist/esm/index.js +1 -1
- package/dist/types/_lonlat.d.ts +5 -2
- package/package.json +7 -7
- package/src/_lonlat.ts +8 -1
package/dist/cjs/_lonlat.js
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
4
4
|
var _isType = require('./_isType.js');
|
|
5
5
|
|
|
6
|
+
var getLatitudeLongitude = function getLatitudeLongitude(lonLat) {
|
|
7
|
+
var _convertLatLng = convertLatLng(lonLat),
|
|
8
|
+
_convertLatLng2 = _slicedToArray(_convertLatLng, 2),
|
|
9
|
+
lon = _convertLatLng2[0],
|
|
10
|
+
lat = _convertLatLng2[1];
|
|
11
|
+
return {
|
|
12
|
+
latitude: lat,
|
|
13
|
+
longitude: lon
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
6
17
|
/**
|
|
7
18
|
* Convert various formats of longitude and latitude to a tuple of [lon, lat].
|
|
8
19
|
* This function supports:
|
|
@@ -76,12 +87,13 @@ var convertToDMS = function convertToDMS(coord) {
|
|
|
76
87
|
* ```
|
|
77
88
|
*/
|
|
78
89
|
var getLocationAsText = function getLocationAsText(latlon) {
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
lon =
|
|
82
|
-
lat =
|
|
90
|
+
var _convertLatLng3 = convertLatLng(latlon),
|
|
91
|
+
_convertLatLng4 = _slicedToArray(_convertLatLng3, 2),
|
|
92
|
+
lon = _convertLatLng4[0],
|
|
93
|
+
lat = _convertLatLng4[1];
|
|
83
94
|
return "".concat(convertToDMS(lat, true), ", ").concat(convertToDMS(lon));
|
|
84
95
|
};
|
|
85
96
|
|
|
86
97
|
exports.convertLatLng = convertLatLng;
|
|
98
|
+
exports.getLatitudeLongitude = getLatitudeLongitude;
|
|
87
99
|
exports.getLocationAsText = getLocationAsText;
|
package/dist/cjs/index.js
CHANGED
|
@@ -108,6 +108,7 @@ exports.isSvgPath = _isType.isSvgPath;
|
|
|
108
108
|
exports.isTrue = _isType.isTrue;
|
|
109
109
|
exports.isUndefined = _isType.isUndefined;
|
|
110
110
|
exports.convertLatLng = _lonlat.convertLatLng;
|
|
111
|
+
exports.getLatitudeLongitude = _lonlat.getLatitudeLongitude;
|
|
111
112
|
exports.getLocationAsText = _lonlat.getLocationAsText;
|
|
112
113
|
exports.mergeRefs = _mergeRefs.mergeRefs;
|
|
113
114
|
exports.iconToken = _tokenize.iconToken;
|
package/dist/esm/_lonlat.js
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import { isArray, isObject, isString } from './_isType.js';
|
|
5
5
|
|
|
6
|
+
var getLatitudeLongitude = function getLatitudeLongitude(lonLat) {
|
|
7
|
+
var _convertLatLng = convertLatLng(lonLat),
|
|
8
|
+
_convertLatLng2 = _slicedToArray(_convertLatLng, 2),
|
|
9
|
+
lon = _convertLatLng2[0],
|
|
10
|
+
lat = _convertLatLng2[1];
|
|
11
|
+
return {
|
|
12
|
+
latitude: lat,
|
|
13
|
+
longitude: lon
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
|
|
6
17
|
/**
|
|
7
18
|
* Convert various formats of longitude and latitude to a tuple of [lon, lat].
|
|
8
19
|
* This function supports:
|
|
@@ -76,11 +87,11 @@ var convertToDMS = function convertToDMS(coord) {
|
|
|
76
87
|
* ```
|
|
77
88
|
*/
|
|
78
89
|
var getLocationAsText = function getLocationAsText(latlon) {
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
lon =
|
|
82
|
-
lat =
|
|
90
|
+
var _convertLatLng3 = convertLatLng(latlon),
|
|
91
|
+
_convertLatLng4 = _slicedToArray(_convertLatLng3, 2),
|
|
92
|
+
lon = _convertLatLng4[0],
|
|
93
|
+
lat = _convertLatLng4[1];
|
|
83
94
|
return "".concat(convertToDMS(lat, true), ", ").concat(convertToDMS(lon));
|
|
84
95
|
};
|
|
85
96
|
|
|
86
|
-
export { convertLatLng, getLocationAsText };
|
|
97
|
+
export { convertLatLng, getLatitudeLongitude, getLocationAsText };
|
package/dist/esm/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export { hash, shortHash, uuid } from './_hash.js';
|
|
|
13
13
|
export { interpolate, renderTemplate } from './_interpolate.js';
|
|
14
14
|
export { compareValues, isEqual, matchString } from './_isEqual.js';
|
|
15
15
|
export { isArray, isBoolean, isColor, isEmpty, isFalse, isNil, isNull, isNumber, isObject, isRtl, isString, isSvgPath, isTrue, isUndefined } from './_isType.js';
|
|
16
|
-
export { convertLatLng, getLocationAsText } from './_lonlat.js';
|
|
16
|
+
export { convertLatLng, getLatitudeLongitude, getLocationAsText } from './_lonlat.js';
|
|
17
17
|
export { mergeRefs } from './_mergeRefs.js';
|
|
18
18
|
export { iconToken, tokenize } from './_tokenize.js';
|
|
19
19
|
export { getImageColorset } from './getImageColorset.js';
|
package/dist/types/_lonlat.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type LngLatLike = {
|
|
1
|
+
export type LngLatLike = {
|
|
2
2
|
lng: number;
|
|
3
3
|
lat: number;
|
|
4
4
|
} | {
|
|
@@ -8,6 +8,10 @@ type LngLatLike = {
|
|
|
8
8
|
longitude: number;
|
|
9
9
|
latitude: number;
|
|
10
10
|
} | [lon: number | string, lat: number | string] | string;
|
|
11
|
+
export declare const getLatitudeLongitude: (lonLat: LngLatLike) => {
|
|
12
|
+
latitude: number;
|
|
13
|
+
longitude: number;
|
|
14
|
+
};
|
|
11
15
|
/**
|
|
12
16
|
* Convert various formats of longitude and latitude to a tuple of [lon, lat].
|
|
13
17
|
* This function supports:
|
|
@@ -42,4 +46,3 @@ export declare const convertLatLng: (lonLat: LngLatLike) => [lon: number, lat: n
|
|
|
42
46
|
* ```
|
|
43
47
|
*/
|
|
44
48
|
export declare const getLocationAsText: (latlon: LngLatLike) => string;
|
|
45
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/utilities",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.58",
|
|
4
4
|
"description": "RUF: Utility package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"date-fns": "
|
|
36
|
-
"libphonenumber-js": "
|
|
37
|
-
"numeral": "
|
|
38
|
-
"yup": "
|
|
35
|
+
"date-fns": "~4.1.0",
|
|
36
|
+
"libphonenumber-js": "~1.12.25",
|
|
37
|
+
"numeral": "~2.0.6",
|
|
38
|
+
"yup": "~1.7.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@types/numeral": "
|
|
41
|
+
"@types/numeral": "~2.0.5"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=18.12.0",
|
|
45
45
|
"npm": ">=8.19.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "7e66f8c498e37a40e410ecafff2ea6b31505dc1a"
|
|
48
48
|
}
|
package/src/_lonlat.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
import { isArray, isObject, isString } from "./_isType";
|
|
25
25
|
|
|
26
|
-
type LngLatLike =
|
|
26
|
+
export type LngLatLike =
|
|
27
27
|
| {
|
|
28
28
|
lng: number;
|
|
29
29
|
lat: number;
|
|
@@ -39,6 +39,13 @@ type LngLatLike =
|
|
|
39
39
|
| [lon: number | string, lat: number | string]
|
|
40
40
|
| string;
|
|
41
41
|
|
|
42
|
+
export const getLatitudeLongitude = (
|
|
43
|
+
lonLat: LngLatLike,
|
|
44
|
+
): { latitude: number; longitude: number } => {
|
|
45
|
+
const [lon, lat] = convertLatLng(lonLat);
|
|
46
|
+
return { latitude: lat, longitude: lon };
|
|
47
|
+
};
|
|
48
|
+
|
|
42
49
|
/**
|
|
43
50
|
* Convert various formats of longitude and latitude to a tuple of [lon, lat].
|
|
44
51
|
* This function supports:
|