everkit-core
v0.1.0
Published
Framework-agnostic, dependency-free utilities shared across React Native / Expo apps: error normalisation, a friendly-message + stable-category mapping, an injectable error handler, and an Expo Go runtime-environment predicate. Pure TypeScript, testable i
Maintainers
Readme
everkit-core
Framework-agnostic, dependency-free utilities shared across the Market Expo apps. Pure TypeScript, testable in plain Node.
Exports
normaliseError(error)→NormalisedError— coerces any thrown value (incl. Supabase Postgrest/Storage plain objects) into a stable shape; never"[object Object]".getUserFriendlyMessage(error, patterns?)/categoriseError(message, patterns?)/ERROR_PATTERNS— map an error to a display string + a stable, non-PII analytics category. Pass an extended pattern table for app-specific phrasing.makeHandleError({ deps, resolveIgnorable?, eventName?, patterns? })→handleError(error, showToast, title?)— the decoupled error handler. Analytics is injected viadeps; the content-moderation short-circuit is generalised to the optionalresolveIgnorablepredicate. Raw messages/stacks are never forwarded to analytics.isExpoGoFrom(info)— pure Expo-Go predicate over an{ executionEnvironment, appOwnership }snapshot. Each app keeps a one-liner:export const isExpoGo = () => isExpoGoFrom(Constants).
Test
npm test # node --require sucrase/register --test "src/**/__tests__/**/*.test.ts"