Gubu: Object Shape Validation Utility
JSON →Gubu is an object shape validation utility for JavaScript and TypeScript, designed to provide a more intuitive and less verbose developer experience compared to alternatives like Joi or JSON-Schema. Currently stable at version 9.0.0, the library differentiates itself with a "Schema By Example" approach, where validation schemas closely mirror the actual data structure. This design simplifies reading and reasoning about validation rules. A key feature is its ability to deeply fill out objects with default values if properties are missing, differing from shallow merge operations like `Object.assign`. It's crucial for developers to note that Gubu deliberately mutates the input object to inject these defaults, a design choice to simplify internal logic and delegate cloning decisions to the calling code. Gubu functions effectively in both browser and Node.js environments and ships with full TypeScript support.
Traffic · last 30 days ↑150% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇫🇷 France · 🇩🇪 Germany