Colota - Android GPS Location tracker
chore: remove unused getByteSize and LARGE_FILE_THRESHOLD exports (#436)
Max Dietrich7bc3acee0b66
diff --git a/apps/mobile/jest.setup.js b/apps/mobile/jest.setup.jsindex d87c8adf..7c266154 100644--- a/apps/mobile/jest.setup.js+++ b/apps/mobile/jest.setup.js@@ -45,15 +45,3 @@ jest.mock("react-native/Libraries/AppState/AppState", () => ({addEventListener: jest.fn(() => ({ remove: jest.fn() }))}}))--// Blob polyfill for getByteSize tests (RN test env doesn't have Blob)-if (typeof global.Blob === "undefined") {- global.Blob = class Blob {- constructor(parts) {- this._content = parts.map((p) => String(p)).join("")- }- get size() {- return Buffer.byteLength(this._content, "utf8")- }- }-}diff --git a/apps/mobile/src/utils/__tests__/exportConverters.test.ts b/apps/mobile/src/utils/__tests__/exportConverters.test.tsindex 79db70cc..95541407 100644--- a/apps/mobile/src/utils/__tests__/exportConverters.test.ts+++ b/apps/mobile/src/utils/__tests__/exportConverters.test.ts@@ -1,11 +1,9 @@import { formatBytes } from "../format"import {- getByteSize,convertTripsToCSV,convertTripsToGeoJSON,convertTripsToGPX,convertTripsToKML,- LARGE_FILE_THRESHOLD,TRIP_CONVERTERS} from "../exportConverters"import { FILE_FORMATS } from "../fileFormats"@@ -50,27 +48,6 @@ describe("formatBytes", () => {})})-describe("getByteSize", () => {- it("returns correct size for ASCII string", () => {- expect(getByteSize("hello")).toBe(5)- })-- it("returns correct size for empty string", () => {- expect(getByteSize("")).toBe(0)- })-- it("handles multi-byte characters", () => {- // UTF-8: ö = 2 bytes- expect(getByteSize("ö")).toBeGreaterThan(1)- })-})--describe("LARGE_FILE_THRESHOLD", () => {- it("is 10 MB", () => {- expect(LARGE_FILE_THRESHOLD).toBe(10 * 1024 * 1024)- })-})-describe("convertTripsToCSV", () => {it("includes trip column in header", () => {const csv = convertTripsToCSV([])diff --git a/apps/mobile/src/utils/exportConverters.ts b/apps/mobile/src/utils/exportConverters.tsindex a961a8c3..37875263 100644--- a/apps/mobile/src/utils/exportConverters.ts+++ b/apps/mobile/src/utils/exportConverters.ts@@ -8,33 +8,12 @@ import { Trip } from "../types/global"import { getTripColor } from "./trips"import { FILE_FORMATS, IMPORT_FORMAT_ORDER } from "./fileFormats"-export const LARGE_FILE_THRESHOLD = 10 * 1024 * 1024 // 10 MB-/** Convert hex RGB (#RRGGBB) to KML's ABGR format (ffBBGGRR) */function hexToKmlColor(hex: string): string {const h = hex.replace("#", "")return `ff${h.slice(4, 6)}${h.slice(2, 4)}${h.slice(0, 2)}`}-export const getByteSize = (content: string): number => {- let bytes = 0- for (let i = 0; i < content.length; i++) {- const code = content.charCodeAt(i)- if (code <= 0x7f) {- bytes += 1- } else if (code <= 0x7ff) {- bytes += 2- } else if (code >= 0xd800 && code <= 0xdbff) {- // High surrogate - pair encodes a 4-byte UTF-8 character- bytes += 4- i++ // skip the low surrogate- } else {- bytes += 3- }- }- return bytes-}-// ============================================================================// TRIP-AWARE CONVERTERS (timestamps in Unix seconds)// ============================================================================