🍦 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 a callback (opts.onError), is emitted as an event (opts.errorEvent), or is thrown (opts.throws). The payload for emission or throwing can also be specified via opts.payload.

We have also simplified the API by removing the readable logical path from the root and the .search() method. Deep iteration of object structures is now safer when explicitly done using a Search() instance with a defined space. This allows early restriction of the search space.

πŸ§ͺ This is an experimental prerelease. Feedback helps shape the API and ensure semantic clarity.



 @fizzwiz 


Comments

Popular posts from this blog

🌐 Plain JavaScript Objects — the True Language of Distributed Systems

🧱 v0.0.0-dev.1 — First Brick

🍦 v0.0.0-dev.2 — Sweet Refinements