@trackunit/shared-utils 0.0.82 → 0.0.83

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/index.cjs.js CHANGED
@@ -716,6 +716,12 @@ const getGeoJsonPolygonFromBoundingBox = (boundingBox) => {
716
716
  ],
717
717
  };
718
718
  };
719
+ /**
720
+ * @description Creates TU point coordinate from a GeoJSON Point.
721
+ */
722
+ const getPointCoordinateFromGeoJsonPoint = (point) => {
723
+ return { latitude: point.coordinates[1], longitude: point.coordinates[0] };
724
+ };
719
725
 
720
726
  /**
721
727
  * Group an array of items by a key.
@@ -1406,6 +1412,7 @@ exports.getGeoJsonPolygonFromBoundingBox = getGeoJsonPolygonFromBoundingBox;
1406
1412
  exports.getISOStringFromDate = getISOStringFromDate;
1407
1413
  exports.getMultipleCoordinatesFromGeoJsonObject = getMultipleCoordinatesFromGeoJsonObject;
1408
1414
  exports.getPointCoordinateFromGeoJsonObject = getPointCoordinateFromGeoJsonObject;
1415
+ exports.getPointCoordinateFromGeoJsonPoint = getPointCoordinateFromGeoJsonPoint;
1409
1416
  exports.getPolygonFromBbox = getPolygonFromBbox;
1410
1417
  exports.getPolygonFromPointAndRadius = getPolygonFromPointAndRadius;
1411
1418
  exports.getResizedDimensions = getResizedDimensions;
package/index.esm.js CHANGED
@@ -714,6 +714,12 @@ const getGeoJsonPolygonFromBoundingBox = (boundingBox) => {
714
714
  ],
715
715
  };
716
716
  };
717
+ /**
718
+ * @description Creates TU point coordinate from a GeoJSON Point.
719
+ */
720
+ const getPointCoordinateFromGeoJsonPoint = (point) => {
721
+ return { latitude: point.coordinates[1], longitude: point.coordinates[0] };
722
+ };
717
723
 
718
724
  /**
719
725
  * Group an array of items by a key.
@@ -1361,4 +1367,4 @@ const uuidv4 = () => {
1361
1367
  */
1362
1368
  const uuidv5 = (name, namespace) => v5(name, namespace);
1363
1369
 
1364
- export { DateTimeFormat, EARTH_RADIUS, HoursAndMinutesFormat, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, capitalize, convertBlobToBase64, convertMetersToYards, convertYardsToMeters, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, filterByMultiple, formatAddress, formatCoordinates, fuzzySearch, geoJsonBboxSchema, geoJsonGeometrySchema, geoJsonLineStringSchema, geoJsonLinearRingSchema, geoJsonMultiLineStringSchema, geoJsonMultiPointSchema, geoJsonMultiPolygonSchema, geoJsonPointSchema, geoJsonPolygonNoHolesSchema, geoJsonPolygonSchema, geoJsonPositionSchema, geoJsonRectangularBoxPolygonSchema, getBoundingBoxFromGeoJsonPolygon, getDifferenceBetweenDates, getEndOfDay, getFirstLevelObjectPropertyDifferences, getGeoJsonPolygonFromBoundingBox, getISOStringFromDate, getMultipleCoordinatesFromGeoJsonObject, getPointCoordinateFromGeoJsonObject, getPolygonFromBbox, getPolygonFromPointAndRadius, getResizedDimensions, getStartOfDay, groupBy, groupTinyDataToOthers, hourIntervals, intersection, isArrayEqual, isSorted, isUUID, isValidImage, nonNullable, numberCompare, numberCompareUnknownAfterHighest, objNotEmpty, objectEntries, objectFromEntries, objectKeys, objectValues, pick, removeLeftPadding, resizeBlob, resizeImage, size, stringCompare, stringCompareFromKey, stringNaturalCompare, stripHiddenCharacters, titleCase, toID, toIDs, toUUID, trimIds, trimPath, truthy, unionArraysByKey, uuidv3, uuidv4, uuidv5 };
1370
+ export { DateTimeFormat, EARTH_RADIUS, HoursAndMinutesFormat, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, capitalize, convertBlobToBase64, convertMetersToYards, convertYardsToMeters, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, filterByMultiple, formatAddress, formatCoordinates, fuzzySearch, geoJsonBboxSchema, geoJsonGeometrySchema, geoJsonLineStringSchema, geoJsonLinearRingSchema, geoJsonMultiLineStringSchema, geoJsonMultiPointSchema, geoJsonMultiPolygonSchema, geoJsonPointSchema, geoJsonPolygonNoHolesSchema, geoJsonPolygonSchema, geoJsonPositionSchema, geoJsonRectangularBoxPolygonSchema, getBoundingBoxFromGeoJsonPolygon, getDifferenceBetweenDates, getEndOfDay, getFirstLevelObjectPropertyDifferences, getGeoJsonPolygonFromBoundingBox, getISOStringFromDate, getMultipleCoordinatesFromGeoJsonObject, getPointCoordinateFromGeoJsonObject, getPointCoordinateFromGeoJsonPoint, getPolygonFromBbox, getPolygonFromPointAndRadius, getResizedDimensions, getStartOfDay, groupBy, groupTinyDataToOthers, hourIntervals, intersection, isArrayEqual, isSorted, isUUID, isValidImage, nonNullable, numberCompare, numberCompareUnknownAfterHighest, objNotEmpty, objectEntries, objectFromEntries, objectKeys, objectValues, pick, removeLeftPadding, resizeBlob, resizeImage, size, stringCompare, stringCompareFromKey, stringNaturalCompare, stripHiddenCharacters, titleCase, toID, toIDs, toUUID, trimIds, trimPath, truthy, unionArraysByKey, uuidv3, uuidv4, uuidv5 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/shared-utils",
3
- "version": "0.0.82",
3
+ "version": "0.0.83",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
@@ -10,7 +10,7 @@ interface BoundingBox {
10
10
  }
11
11
  interface GeoJSONGeometry {
12
12
  type?: unknown;
13
- coordinates?: number[] | number[][] | null;
13
+ coordinates?: number[] | number[][] | number[][][] | null;
14
14
  }
15
15
  interface GeoJsonFeature {
16
16
  type?: unknown;
@@ -45,4 +45,8 @@ export declare const getBoundingBoxFromGeoJsonPolygon: (polygon: GeoJsonPolygon)
45
45
  * @description Creates a GeoJSON Polygon from a TU bounding box.
46
46
  */
47
47
  export declare const getGeoJsonPolygonFromBoundingBox: (boundingBox: BoundingBox) => GeoJsonPolygon;
48
+ /**
49
+ * @description Creates TU point coordinate from a GeoJSON Point.
50
+ */
51
+ export declare const getPointCoordinateFromGeoJsonPoint: (point: GeoJsonPoint) => PointCoordinate;
48
52
  export {};