Posts

Showing posts from December, 2025

🛡️ Safe and Declarative Input Handling with ObjNavigator

🛡️ Safe and Declarative Input Handling with   ObjNavigator When building   distributed systems ,   WebSocket pipelines , or   HTTP APIs , you constantly handle data from outside your trust boundary. Query parameters, JSON payloads, and message frames often arrive as   strings , may be   malformed , and should never be consumed directly by business logic. Before using input, it should be: Coerced   into runtime types (numbers, booleans, dates, etc.) Validated   against business rules Handled safely   when invalid — often   without throwing In asynchronous or message-driven systems, throwing exceptions is often impractical. Errors must be   reported, emitted, or logged , while the system continues running. Traditional imperative handling leads to boilerplate like this: try { const value = Number (req. query . value ); if ( isNaN (value) || value < 0 ) throw new Error ( "Invalid value" ); // business logic here } catch...

🍦 v0.0.0-dev.5 — Major Advancement

🍦 v0.0.0-dev.5 — Major Advancement We’re excited to release   v0.0.0-dev.5   of   @fizzwiz/vanilla , introducing significant semantic enhancements. This version brings   contextual navigation   via expressions,   validation   via   coerce()   and   validate() , and   fine-grained error handling   via   opts : Expressions:   Most   ObjNavigator   methods now accept not only static paths to the next context but also functions returning the next context. The next context can be a nested sub-object or an independent object. This enables context-specific navigation, such as using CSS query selectors when navigating DOM documents. Validation:   Two new methods,   coerce()   and   validate() , allow precise validation and coercion of input objects. Opts:   These methods accept an optional   opts   parameter for fine-grained error handling. You can define whether an error triggers...