question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose accessors so they can be composed

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
evanshortisscommented, Jun 6, 2020

@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

1reaction
satazorcommented, May 13, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found