@trackunit/shared-utils 0.0.85 → 0.0.86

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.esm.js CHANGED
@@ -1,5 +1,3 @@
1
- import { z } from 'zod';
2
- import { intersection as intersection$1 } from 'polygon-clipping';
3
1
  import { v3, v4, v5 } from 'uuid';
4
2
 
5
3
  /**
@@ -413,493 +411,6 @@ searchTerm) => {
413
411
  .every(term => filterableProps(asset).some(value => value.toLowerCase().includes(term.toLowerCase()))));
414
412
  };
415
413
 
416
- // * NOTE: For simplicity these tools are built for 2D coordinate space only!
417
- /**
418
- * A Position is an array of coordinates. [x, y]
419
- * https://tools.ietf.org/html/rfc7946#section-3.1.1
420
- */
421
- const geoJsonPositionSchema = z.tuple([z.number(), z.number()]);
422
- /**
423
- * Point geometry object.
424
- * https://tools.ietf.org/html/rfc7946#section-3.1.2
425
- */
426
- const geoJsonPointSchema = z.strictObject({
427
- type: z.literal("Point"),
428
- coordinates: geoJsonPositionSchema,
429
- });
430
- /**
431
- * MultiPoint geometry object.
432
- * https://tools.ietf.org/html/rfc7946#section-3.1.3
433
- */
434
- const geoJsonMultiPointSchema = z.strictObject({
435
- type: z.literal("MultiPoint"),
436
- coordinates: z.array(geoJsonPositionSchema),
437
- });
438
- /**
439
- * LineString geometry object.
440
- * Minimum length of 2 positions.
441
- * https://tools.ietf.org/html/rfc7946#section-3.1.4
442
- */
443
- const geoJsonLineStringSchema = z.strictObject({
444
- type: z.literal("LineString"),
445
- coordinates: z.array(geoJsonPositionSchema).min(2),
446
- });
447
- /**
448
- * MultiLineString geometry object.
449
- * https://tools.ietf.org/html/rfc7946#section-3.1.5
450
- */
451
- const geoJsonMultiLineStringSchema = z.strictObject({
452
- type: z.literal("MultiLineString"),
453
- coordinates: z.array(z.array(geoJsonPositionSchema)),
454
- });
455
- /**
456
- * Helper type for reuse across polygon schemas.
457
- *
458
- * - A linear ring is a closed LineString with four or more positions.
459
- * - The first and last positions are equivalent, and they MUST contain
460
- identical values; their representation SHOULD also be identical
461
- * - A linear ring is the boundary of a surface or the boundary of a
462
- hole in a surface
463
- * - A linear ring MUST follow the right-hand rule with respect to the
464
- area it bounds, i.e., exterior rings are counterclockwise, and
465
- holes are clockwise
466
- */
467
- const geoJsonLinearRingSchema = z
468
- .array(geoJsonPositionSchema)
469
- .min(4, {
470
- message: "Coordinates array must contain at least 4 positions. 3 to make a non-line shape and 1 to close the shape (duplicate of first)",
471
- })
472
- .superRefine((coords, ctx) => {
473
- const first = coords[0];
474
- const last = coords[coords.length - 1];
475
- // Check if first and last coordinates match
476
- if (JSON.stringify(first) !== JSON.stringify(last)) {
477
- ctx.addIssue({
478
- code: z.ZodIssueCode.custom,
479
- message: "First and last coordinate positions must be identical (to close the linear ring aka polygon).",
480
- });
481
- }
482
- // Check if consecutive points are identical (excluding first and last)
483
- for (let i = 1; i < coords.length - 1; i++) {
484
- if (JSON.stringify(coords[i]) === JSON.stringify(coords[i - 1])) {
485
- ctx.addIssue({
486
- code: z.ZodIssueCode.custom,
487
- message: `Consecutive coordinates at index ${i - 1} and ${i} should not be identical.`,
488
- });
489
- }
490
- }
491
- });
492
- /**
493
- * Polygon geometry object.
494
- * https://tools.ietf.org/html/rfc7946#section-3.1.6
495
- */
496
- const geoJsonPolygonSchema = z.strictObject({
497
- type: z.literal("Polygon"),
498
- coordinates: z.array(geoJsonLinearRingSchema),
499
- });
500
- /**
501
- * MultiPolygon geometry object.
502
- * https://tools.ietf.org/html/rfc7946#section-3.1.7
503
- */
504
- const geoJsonMultiPolygonSchema = z.strictObject({
505
- type: z.literal("MultiPolygon"),
506
- coordinates: z.array(z.array(geoJsonLinearRingSchema)),
507
- });
508
- // The same for Geometry, GeometryCollection, GeoJsonProperties, Feature, FeatureCollection, etc.
509
- const geoJsonGeometrySchema = z.union([
510
- geoJsonPointSchema,
511
- geoJsonMultiPointSchema,
512
- geoJsonLineStringSchema,
513
- geoJsonMultiLineStringSchema,
514
- geoJsonPolygonSchema,
515
- geoJsonMultiPolygonSchema,
516
- ]);
517
- //* -------- Bbox -------- *//
518
- /**
519
- * 2D bounding box of the GeoJSON object.
520
- * The value of the Bbox member is an array of length 4.
521
- *
522
- * [min_lon, min_lat, max_lon, max_lat]
523
- */
524
- const geoJsonBboxSchema = z
525
- .tuple([z.number(), z.number(), z.number(), z.number()])
526
- .refine(([minLng, minLat, maxLng, maxLat]) => maxLng > minLng && maxLat > minLat, {
527
- message: "Invalid bounding box: maxLng should be greater than minLng, and maxLat should be greater than minLat.",
528
- });
529
-
530
- const EARTH_RADIUS = 6378137; // Earth’s mean radius in meters
531
- /**
532
- * @description Creates a polygon (with no holes) from a bounding box.
533
- */
534
- const getPolygonFromBbox = (bbox) => {
535
- const [minLon, minLat, maxLon, maxLat] = bbox;
536
- return {
537
- type: "Polygon",
538
- coordinates: [
539
- [
540
- [minLon, minLat],
541
- [maxLon, minLat],
542
- [maxLon, maxLat],
543
- [minLon, maxLat],
544
- [minLon, minLat],
545
- ],
546
- ],
547
- };
548
- };
549
- /**
550
- * @description Creates a bounding box from a GeoJSON Polygon.
551
- */
552
- const getBboxFromGeoJsonPolygon = (polygon) => {
553
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
554
- if (!polygonParsed.success) {
555
- return null;
556
- }
557
- const points = polygonParsed.data.coordinates[0];
558
- if (!points) {
559
- // Should never happen since the schema checks for it
560
- return null;
561
- }
562
- const latitudes = points.map(point => point[1]);
563
- const longitudes = points.map(point => point[0]);
564
- return [Math.min(...longitudes), Math.min(...latitudes), Math.max(...longitudes), Math.max(...latitudes)];
565
- };
566
- /**
567
- * @description Creates a round polygon from a point and a radius.
568
- */
569
- const getPolygonFromPointAndRadius = (point, radius) => {
570
- const [lon, lat] = point.coordinates;
571
- // Adjust the number of points based on radius (resolution)
572
- const pointsCount = Math.max(32, Math.floor(radius / 100)); // More points for larger radius
573
- const angleStep = (2 * Math.PI) / pointsCount;
574
- const coordinates = [];
575
- for (let i = 0; i <= pointsCount; i++) {
576
- const angle = i * angleStep;
577
- // Calculate offset in latitude and longitude
578
- const deltaLat = (radius / EARTH_RADIUS) * (180 / Math.PI);
579
- const deltaLon = deltaLat / Math.cos((lat * Math.PI) / 180);
580
- // Calculate new coordinates based on angle
581
- const newLat = lat + deltaLat * Math.sin(angle);
582
- const newLon = lon + deltaLon * Math.cos(angle);
583
- coordinates.push([newLon, newLat]);
584
- }
585
- return {
586
- type: "Polygon",
587
- coordinates: [coordinates],
588
- };
589
- };
590
- /**
591
- * @description Creates a TU bounding box from a GeoJson Polygon.
592
- */
593
- const getBoundingBoxFromGeoJsonPolygon = (polygon) => {
594
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
595
- if (!polygonParsed.success) {
596
- return null;
597
- }
598
- const points = polygonParsed.data.coordinates[0];
599
- if (!points) {
600
- // Should never happen since the schema checks for it
601
- return null;
602
- }
603
- const latitudes = points.map(point => point[1]);
604
- const longitudes = points.map(point => point[0]);
605
- return {
606
- nw: {
607
- latitude: Math.max(...latitudes),
608
- longitude: Math.min(...longitudes),
609
- },
610
- se: {
611
- latitude: Math.min(...latitudes),
612
- longitude: Math.max(...longitudes),
613
- },
614
- };
615
- };
616
- /**
617
- * @description Creates a GeoJSON Polygon from a TU bounding box.
618
- */
619
- const getGeoJsonPolygonFromBoundingBox = (boundingBox) => {
620
- const { nw, se } = boundingBox;
621
- return {
622
- type: "Polygon",
623
- coordinates: [
624
- [
625
- [nw.longitude, nw.latitude], // Northwest corner
626
- [se.longitude, nw.latitude], // Northeast corner
627
- [se.longitude, se.latitude], // Southeast corner
628
- [nw.longitude, se.latitude], // Southwest corner
629
- [nw.longitude, nw.latitude], // Close the loop back to Northwest corner
630
- ],
631
- ],
632
- };
633
- };
634
- /**
635
- * @description Creates TU point coordinate from a GeoJSON Point.
636
- */
637
- const getPointCoordinateFromGeoJsonPoint = (point) => {
638
- return { latitude: point.coordinates[1], longitude: point.coordinates[0] };
639
- };
640
- /**
641
- * @description Gets the extreme point of a polygon in a given direction.
642
- * @param {object} params - The parameters object
643
- * @param {GeoJsonPolygon} params.polygon - The polygon to get the extreme point from
644
- * @param {("top" | "right" | "bottom" | "left")} params.direction - The direction to get the extreme point in
645
- * @returns {GeoJsonPoint} The extreme point in the given direction
646
- */
647
- const getExtremeGeoJsonPointFromPolygon = ({ polygon, direction, }) => {
648
- var _a, _b, _c;
649
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
650
- if (!polygonParsed.success) {
651
- return null;
652
- }
653
- const firstPoint = (_a = polygonParsed.data.coordinates[0]) === null || _a === void 0 ? void 0 : _a[0];
654
- if (!firstPoint) {
655
- // Should never happen since the schema checks for it
656
- return null;
657
- }
658
- const extremePosition = (_b = polygonParsed.data.coordinates[0]) === null || _b === void 0 ? void 0 : _b.reduce((extremePoint, currentPoint) => {
659
- var _a, _b, _c, _d;
660
- switch (direction) {
661
- case "top":
662
- return currentPoint[1] > ((_a = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _a !== void 0 ? _a : -Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint;
663
- case "right":
664
- return currentPoint[0] > ((_b = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _b !== void 0 ? _b : -Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint;
665
- case "bottom":
666
- return currentPoint[1] < ((_c = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[1]) !== null && _c !== void 0 ? _c : Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint;
667
- case "left":
668
- return currentPoint[0] < ((_d = extremePoint === null || extremePoint === void 0 ? void 0 : extremePoint[0]) !== null && _d !== void 0 ? _d : Infinity) ? currentPoint : extremePoint !== null && extremePoint !== void 0 ? extremePoint : currentPoint;
669
- default: {
670
- throw new Error(`${direction} is not known`);
671
- }
672
- }
673
- }, (_c = polygonParsed.data.coordinates[0]) === null || _c === void 0 ? void 0 : _c[0]);
674
- return extremePosition
675
- ? {
676
- type: "Point",
677
- coordinates: extremePosition,
678
- }
679
- : null; // Should never happen since the schema checks for it
680
- };
681
- /**
682
- * Checks if a position is inside a linear ring. On edge is considered inside.
683
- */
684
- const isGeoJsonPositionInLinearRing = ({ position, linearRing, }) => {
685
- const linearRingParsed = geoJsonLinearRingSchema.safeParse(linearRing);
686
- if (!linearRingParsed.success) {
687
- return null;
688
- }
689
- let inside = false;
690
- const [x, y] = position;
691
- for (let i = 0, j = linearRingParsed.data.length - 1; i < linearRingParsed.data.length; j = i++) {
692
- const point1 = linearRingParsed.data[i];
693
- const point2 = linearRingParsed.data[j];
694
- if (!point1 || !point2) {
695
- continue;
696
- }
697
- const [xi, yi] = point1;
698
- const [xj, yj] = point2;
699
- const intersect = yi > y !== yj > y && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi;
700
- if (intersect) {
701
- inside = !inside;
702
- }
703
- }
704
- return inside;
705
- };
706
- /**
707
- * @description Checks if a point is inside a polygon.
708
- */
709
- const isGeoJsonPointInPolygon = ({ point, polygon, }) => {
710
- const polygonParsed = geoJsonPolygonSchema.safeParse(polygon);
711
- if (!polygonParsed.success) {
712
- return null;
713
- }
714
- return polygonParsed.data.coordinates.some(linearRing => isGeoJsonPositionInLinearRing({ position: point.coordinates, linearRing }));
715
- };
716
- /**
717
- * Checks if polygon1 is fully contained within polygon2
718
- */
719
- const isFullyContainedInGeoJsonPolygon = (polygon1, polygon2) => {
720
- const polygon1Parsed = geoJsonPolygonSchema.safeParse(polygon1);
721
- const polygon2Parsed = geoJsonPolygonSchema.safeParse(polygon2);
722
- // The schema checks more than a TypeScript type can represent
723
- if (!polygon1Parsed.success || !polygon2Parsed.success) {
724
- return null;
725
- }
726
- return polygon1Parsed.data.coordinates.every(linearRing => polygon2Parsed.data.coordinates.some(lr => linearRing.every(position => isGeoJsonPositionInLinearRing({ position, linearRing: lr }))));
727
- };
728
- /**
729
- * @description Gets the intersection between two GeoJSON polygons. If one polygon is fully contained within the other,
730
- * returns the contained polygon. Otherwise returns a MultiPolygon representing the intersection.
731
- * @param polygon1 The first polygon to check intersection
732
- * @param polygon2 The second polygon to check intersection
733
- * @returns {(GeoJsonMultiPolygon | GeoJsonPolygon)} The intersection as either a Polygon (if one contains the other) or MultiPolygon
734
- */
735
- const getGeoJsonPolygonIntersection = (polygon1, polygon2) => {
736
- const polygon1Parsed = geoJsonPolygonSchema.safeParse(polygon1);
737
- const polygon2Parsed = geoJsonPolygonSchema.safeParse(polygon2);
738
- if (!polygon1Parsed.success || !polygon2Parsed.success) {
739
- return null;
740
- }
741
- if (isFullyContainedInGeoJsonPolygon(polygon1, polygon2)) {
742
- return polygon1;
743
- }
744
- if (isFullyContainedInGeoJsonPolygon(polygon2, polygon1)) {
745
- return polygon2;
746
- }
747
- const intersectionResult = intersection$1(polygon1.coordinates, polygon2.coordinates);
748
- if (intersectionResult.length === 1 && intersectionResult[0]) {
749
- return {
750
- type: "Polygon",
751
- coordinates: intersectionResult[0],
752
- };
753
- }
754
- return {
755
- type: "MultiPolygon",
756
- coordinates: intersection$1(polygon1.coordinates, polygon2.coordinates),
757
- };
758
- };
759
-
760
- //! These tools are used to bridge the gap with out poorly typed graphql types
761
- // Should be ideally be avoided but are needed until we fix the graphql types
762
- const isDoubleNestedCoords = (coords) => Array.isArray(coords) &&
763
- Array.isArray(coords[0]) &&
764
- Array.isArray(coords[0][0]) &&
765
- typeof coords[0][0][0] === "number";
766
- const isSingleCoords = (coords) => typeof coords[0] === "number";
767
- /**
768
- * @description Returns coordinates in consistent format
769
- * @param inconsistentCoordinates Single point, array of points or nested array of points
770
- * @returns {GeoJsonPosition[]} Array of standardized coordinates
771
- */
772
- const coordinatesToStandardFormat = (inconsistentCoordinates) => {
773
- if (!inconsistentCoordinates) {
774
- return [];
775
- }
776
- if (isSingleCoords(inconsistentCoordinates)) {
777
- return [inconsistentCoordinates];
778
- }
779
- if (isDoubleNestedCoords(inconsistentCoordinates)) {
780
- return inconsistentCoordinates[0] || [];
781
- }
782
- if (inconsistentCoordinates[0] && typeof inconsistentCoordinates[0][0] === "number") {
783
- return inconsistentCoordinates;
784
- }
785
- return [];
786
- };
787
- /**
788
- * @description Extracts a point coordinate from a GeoJSON object.
789
- * @param geoObject A GeoJSON object.
790
- * @returns {PointCoordinate} A point coordinate.
791
- */
792
- const getPointCoordinateFromGeoJsonObject = (geoObject) => {
793
- if (!geoObject) {
794
- return undefined;
795
- }
796
- else if ("geometry" in geoObject) {
797
- return getPointCoordinateFromGeoJsonObject(geoObject.geometry);
798
- }
799
- else if ("coordinates" in geoObject &&
800
- Array.isArray(geoObject.coordinates) &&
801
- typeof geoObject.coordinates[0] === "number" &&
802
- typeof geoObject.coordinates[1] === "number") {
803
- const [point] = coordinatesToStandardFormat(geoObject.coordinates);
804
- if (point) {
805
- return { latitude: point[1], longitude: point[0] };
806
- }
807
- else {
808
- throw new Error(`Unable to extract point coordinate from ${JSON.stringify(geoObject)}`);
809
- }
810
- }
811
- else {
812
- throw new Error(`Unable to extract point coordinate from ${JSON.stringify(geoObject)}`);
813
- }
814
- };
815
- /**
816
- * @description Extracts multiple point coordinates from a GeoJSON object.
817
- * @param geoObject A GeoJSON object.
818
- * @returns {PointCoordinate[]} An array of point coordinates.
819
- * @example getMultipleCoordinatesFromGeoJsonObject({ type: "Point", coordinates: [1, 2] }) // [{ longitude: 1, latitude: 2 }]
820
- */
821
- const getMultipleCoordinatesFromGeoJsonObject = (geoObject) => {
822
- if (!geoObject) {
823
- return undefined;
824
- }
825
- else if ("geometry" in geoObject) {
826
- return getMultipleCoordinatesFromGeoJsonObject(geoObject.geometry);
827
- }
828
- else if ("coordinates" in geoObject) {
829
- return coordinatesToStandardFormat(geoObject.coordinates).map(([longitude, latitude]) => ({ longitude, latitude }));
830
- }
831
- else {
832
- throw new Error(`Unable to extract point coordinate from ${JSON.stringify(geoObject)}`);
833
- }
834
- };
835
-
836
- //* -------- Trackunit-invented schemas and types to extend the GeoJson spec -------- *//
837
- /**
838
- * Polygon geometry object that explicitly disallows holes.
839
- *
840
- * Same as geoJsonPolygonSchema but type disallows holes by
841
- * using tuple of one single linear ring instead of an array.
842
- */
843
- const tuGeoJsonPolygonNoHolesSchema = z.strictObject({
844
- //The type is still "Polygon" (not PolygonNoHoles or similar) since it's always
845
- //compliant with Polygon, just not the other way around
846
- type: z.literal("Polygon"),
847
- //uses tuple instead of array to enforce only 1 linear ring aka the polygon itself
848
- coordinates: z.tuple([geoJsonLinearRingSchema]),
849
- });
850
- /**
851
- * Point radius object.
852
- * For when you wish to define an area by a point and a radius.
853
- *
854
- * radius is in meters
855
- */
856
- const tuGeoJsonPointRadiusSchema = z.strictObject({
857
- type: z.literal("PointRadius"),
858
- coordinates: geoJsonPositionSchema,
859
- radius: z.number().positive(), // in meters
860
- });
861
- /**
862
- * A Polygon with exactly 5 points and 4 horizontal/vertical sides that form a normal rectangular box.
863
- */
864
- const tuGeoJsonRectangularBoxPolygonSchema = z
865
- .strictObject({
866
- type: z.literal("Polygon"),
867
- coordinates: z.array(geoJsonLinearRingSchema),
868
- })
869
- .superRefine((data, ctx) => {
870
- const coordinates = data.coordinates[0];
871
- // Validate polygon has exactly 5 points
872
- if ((coordinates === null || coordinates === void 0 ? void 0 : coordinates.length) !== 5) {
873
- ctx.addIssue({
874
- code: z.ZodIssueCode.custom,
875
- message: "Polygon must have exactly 5 coordinates to form a closed box.",
876
- });
877
- return;
878
- }
879
- // Check each side is either horizontal or vertical
880
- for (let i = 0; i < 4; i++) {
881
- const point1 = coordinates[i];
882
- const point2 = coordinates[i + 1];
883
- if (point1 === undefined || point2 === undefined) {
884
- ctx.addIssue({
885
- code: z.ZodIssueCode.custom,
886
- message: "Each coordinate must be a defined point.",
887
- });
888
- return;
889
- }
890
- const [x1, y1] = point1;
891
- const [x2, y2] = point2;
892
- // Ensure each line segment is either horizontal or vertical
893
- if (x1 !== x2 && y1 !== y2) {
894
- ctx.addIssue({
895
- code: z.ZodIssueCode.custom,
896
- message: "Polygon sides must be horizontal or vertical to form a box shape.",
897
- });
898
- return;
899
- }
900
- }
901
- });
902
-
903
414
  /**
904
415
  * Group an array of items by a key.
905
416
  *
@@ -1546,4 +1057,4 @@ const uuidv4 = () => {
1546
1057
  */
1547
1058
  const uuidv5 = (name, namespace) => v5(name, namespace);
1548
1059
 
1549
- export { DateTimeFormat, EARTH_RADIUS, HoursAndMinutesFormat, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, capitalize, convertBlobToBase64, convertMetersToYards, convertYardsToMeters, coordinatesToStandardFormat, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, filterByMultiple, formatAddress, formatCoordinates, fuzzySearch, geoJsonBboxSchema, geoJsonGeometrySchema, geoJsonLineStringSchema, geoJsonLinearRingSchema, geoJsonMultiLineStringSchema, geoJsonMultiPointSchema, geoJsonMultiPolygonSchema, geoJsonPointSchema, geoJsonPolygonSchema, geoJsonPositionSchema, getBboxFromGeoJsonPolygon, getBoundingBoxFromGeoJsonPolygon, getDifferenceBetweenDates, getEndOfDay, getExtremeGeoJsonPointFromPolygon, getFirstLevelObjectPropertyDifferences, getGeoJsonPolygonFromBoundingBox, getGeoJsonPolygonIntersection, getISOStringFromDate, getMultipleCoordinatesFromGeoJsonObject, getPointCoordinateFromGeoJsonObject, getPointCoordinateFromGeoJsonPoint, getPolygonFromBbox, getPolygonFromPointAndRadius, getResizedDimensions, getStartOfDay, groupBy, groupTinyDataToOthers, hourIntervals, intersection, isArrayEqual, isFullyContainedInGeoJsonPolygon, isGeoJsonPointInPolygon, isGeoJsonPositionInLinearRing, 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, tuGeoJsonPointRadiusSchema, tuGeoJsonPolygonNoHolesSchema, tuGeoJsonRectangularBoxPolygonSchema, unionArraysByKey, uuidv3, uuidv4, uuidv5 };
1060
+ export { DateTimeFormat, HoursAndMinutesFormat, align, alphabeticallySort, arrayLengthCompare, arrayNotEmpty, booleanCompare, capitalize, convertBlobToBase64, convertMetersToYards, convertYardsToMeters, dateCompare, deleteUndefinedKeys, difference, doNothing, enumFromValue, enumFromValueTypesafe, enumOrUndefinedFromValue, exhaustiveCheck, filterByMultiple, formatAddress, formatCoordinates, fuzzySearch, getDifferenceBetweenDates, getEndOfDay, getFirstLevelObjectPropertyDifferences, getISOStringFromDate, 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,15 +1,13 @@
1
1
  {
2
2
  "name": "@trackunit/shared-utils",
3
- "version": "0.0.85",
3
+ "version": "0.0.86",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=20.x"
8
8
  },
9
9
  "dependencies": {
10
- "uuid": "^10.0.0",
11
- "zod": "3.22.4",
12
- "polygon-clipping": "^0.15.7"
10
+ "uuid": "^10.0.0"
13
11
  },
14
12
  "module": "./index.esm.js",
15
13
  "main": "./index.cjs.js",
package/src/index.d.ts CHANGED
@@ -9,10 +9,6 @@ export * from "./enumUtils";
9
9
  export * from "./exhaustiveCheck";
10
10
  export * from "./fastArrayOperations";
11
11
  export * from "./filter";
12
- export * from "./GeoJson/GeoJsonSchemas";
13
- export * from "./GeoJson/GeoJsonUtils";
14
- export * from "./GeoJson/TUGeoJsonObjectBridgeUtils";
15
- export * from "./GeoJson/TuGeoJsonSchemas";
16
12
  export * from "./groupBy/groupBy";
17
13
  export * from "./GroupingUtility";
18
14
  export * from "./idUtils";