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.

[Feature request] can preCondition have option to provide default value aside from null?

See original GitHub issue

Now the preCondition can check and map the property to null when checking result is falsely. Can this function provide a way to set the default value aside from null ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ymchuncommented, Jan 27, 2020

@nartc I’ve submitted PR, plz check

1reaction
nartccommented, Jan 26, 2020

@ymchun Thanks for the request. preCondition with defaultValue has been added in version 3.1. I also added defaultValue to condition() as well since I think it should be supported.

Mapper.createMap(Model, ViewModel)
   .forMember(d => d.destination, opts => opts.preCondition(predicate, defaultValue))
Read more comments on GitHub >

github_iconTop Results From Across the Web

Preconditions — Part I | Andrzej's C++ blog - WordPress.com
In this post, I want to share my thoughts about the notion of precondition. In “Design by Contract” philosophy, preconditions are always ...
Read more >
Support for fromFieldPath, nil/null and default value in map ...
So we are basically trying to build a package that offers claim to create sqldatabase instances on AWS on-demand (dynamic provisioning). User ...
Read more >
Post Terraform v1.0 features I love - Brendan Thompson
With precondition and postcondition , we can validate/ensure the state of our resources, data sources, and outputs. Having a nullable input ...
Read more >
Immutable objects
Since version 2.2 . @Value. Default and @Nullable collection attributes are supported so you can provide default value if no values have been...
Read more >
Cross-Origin Resource Sharing (CORS) - MDN Web Docs
Additionally, for HTTP request methods that can cause ... Apart from the headers automatically set by the user agent (for example, ...
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