Expose accessors so they can be composed
See original GitHub issueIs your feature request related to a problem? Please describe. I would like to access the internal accessors, so that I can create new ones, while using the built-in accessors internally.
Describe the solution you’d like
Exposing the accessors, like env.accessors
.
Describe alternatives you’ve considered
At the moment, I’m importing lib/accessors/xxx
, which is far from ideal, as they are not part of the public API.
Additional context
Example:
asIntRange: (value, range) => {
value = asInt(value);
if (value < range[0] || value >= range[1]) {
throw new Error(`to be within range [${range[0]},${range[1]}]`);
}
return value;
},
where asInt
is the lib/accessors/int.js
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Properties - C# Programming Guide - Microsoft Learn
Property accessors often consist of single-line statements that just assign or return the result of an expression. You can implement these ...
Read more >Why do you write accessor methods? - codecentric Blog
The accessor methods do not even have to be hand-written, but can be generated quite easily by the IDE or even more convenient...
Read more >Exposing Typesafe Accessors to Clients - Oracle
By exposing typesafe accessors for view object attributes, you can make coding and maintaining Oracle ADF Business Components clients and service methods ...
Read more >Why use getters and setters/accessors? - Stack Overflow
There are actually many good reasons to consider using accessors rather than directly exposing fields of a class - beyond just the argument ......
Read more >Properties In C#
Usually, inside a class, we declare a data field as private and will provide a set of public SET and GET methods to...
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
@satazor this will be available in 6.2.0
Edit: Please give it a try in the next few days
npm install evanshortiss/env-var#6.x
I will put this into my TODO list, however don’t wait on me and if anyone want’s to tackle this please go ahead.