Core utilities for structured object management and type-based options.
Provides:
- OptionStore — type-based option storage and retrieval.
- ObjNavigator — nested object navigation and manipulation.
- See:
Example
import { OptionStore, ObjNavigator } from '@fizzwiz/vanilla';
// OptionStore example
class Base {}
class Derived extends Base {}
const options = OptionStore.as({});
options.set(Base, "color", "blue");
options.set(Derived, "color", "red");
console.log(options.get(Derived, "color")); // "red"
// ObjNavigator example
const navigator = ObjNavigator.as({});
navigator.set("user.profile.name", "Alice");
const profileNavigator = store.with("user.profile");
profileNavigator.set("age", 30);
console.log(navigator.get("user.profile.age")); // 30