π¦ 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
ObjNavigatormethods 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()andvalidate(), allow precise validation and coercion of input objects. - Opts: These methods accept an optional
optsparameter 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 viaopts.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.
π¦ Get it on npm: https://www.npmjs.com/package/@fizzwiz/vanilla
— @fizzwiz ✨
Comments
Post a Comment