Using getters for some functionality?
See original GitHub issue// Before: `.number()`, `.optional()` etc. as methods
const union = z.union([z.number(), z.boolean()]);
const optionalString = z.string().optional();
// After: `.number()`, `.optional()` etc. as getters
const union = z.union([z.number, z.boolean]);
const optionalString = z.string.optional;
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Getters and Setters in Java Explained - freeCodeCamp
Getters and setters are used to protect your data, particularly when creating classes. For each instance variable, a getter method returns ...
Read more >getter - JavaScript - MDN Web Docs - Mozilla
Getters give you a way to define a property of an object, but they do not calculate the property's value until it is...
Read more >Getter and Setter in Java - GeeksforGeeks
Getter returns the value (accessors), it returns the value of data type int, String, double, float, etc. For the program's convenience, getter ......
Read more >Property getters and setters - The Modern JavaScript Tutorial
Accessor properties are represented by “getter” and “setter” methods. In an object literal they are denoted by get and set :.
Read more >9.9. Access Functions: Getters and Setters
Accessor or getter functions allow clients to get the value saved in one of a supplier object's member variables. Getter functions are typically...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, that’s right. 👍
You bet - thanks for the suggestion! 🤙