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.

Have validate accept null and undefined

See original GitHub issue

Just to make life easier, it would be great if when I call uuidValidate and pass in null or undefined, it returned false. Right now the compiler doesn’t allow a potentially null/undefined value to be given.

Right now I’m doing something like this:

this.route.paramMap
    .pipe(
        map(x => x.get('id')),
        filter(x => !!x && uuidValidate(x)),
        mustHaveValue(),
        switchMap(x => this.clientService.get(x)),
        untilDestroyed(this)
    )

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
ctavancommented, Sep 12, 2022

Reopening as this may be solved in #654.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to check for an undefined or null variable in JavaScript?
I think the most efficient way to test for "value is null or undefined " is if ( some_variable == null ){ //...
Read more >
JavaScript: Check if Variable is undefined or null - Stack Abuse
There are two approaches you can opt for when checking whether a variable is undefined or null in vanilla JavaScript.
Read more >
null - JavaScript - MDN Web Docs - Mozilla
The null value represents the intentional absence of any object value. ... When checking for null or undefined , beware of the differences...
Read more >
JavaScript Program To Check If A Variable Is undefined or null
The typeof operator for undefined value returns undefined . Hence, you can check the undefined value using typeof operator. Also, null values are...
Read more >
Documentation - TypeScript 2.0
In strict null checking mode, the null and undefined values are not in the domain of every type and are only assignable 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