core
npmShared primitives used across all Angular Helpers packages — platform detection, Transferable helpers, and Worker pooling.
import { injectPlatform, injectWorkerPool, isTransferable } from '@angular-helpers/core';
// No provider setup required — all utilities are standalone inject() functions.
// pnpm add @angular-helpers/core🖥️ Platform
injectPlatform
Composable that resolves the current platform environment using Angular's Dependency Injection. Returns a typed object with `isBrowser`, `isServer`, `window`, and `document` fields. Gracefully falls back when called outside an injection context (e.g. unit tests).
injectErrorBoundaryReporter
Injects an error reporter function that bubbles errors into the nearest Angular 22+ @boundary / ErrorBoundary block, or falls back gracefully to ErrorHandler.
⚙️ Workers & Transferables
isTransferable
Pure predicate that returns `true` if a value is a `Transferable` instance that can be moved zero-copy via `postMessage`. Guards every Transferable type with a `typeof` check so it is safe in Web Workers, Node.js, and SSR contexts where some globals may be absent.
WorkerPool / injectWorkerPool
Manages a pool of Web Workers with round-robin job dispatch. `injectWorkerPool` is the DI-aware factory that automatically terminates all workers when the injection context is destroyed. Used internally by `@angular-helpers/security` to run ReDoS-safe regex operations off the main thread.