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.

[Question] dealing with parent children relationship

See original GitHub issue

👋this library has been awesome for validating properties both static and dynamic which is great so thanks!

my question has there been any thoughts when for example you need to find duplicates

from the docs:

const input = {
  id: 4,
  users: {
    one: {firstName: 'foobar', lastName: 'action'},
    two: {firstName: 'foo', lastName: 'bar'},
    three: {firstName: 'foobar', lastName: 'Action'},
  }
}

const validationRules = {
  id: [[ notEmpty, notEmptyMsg('id') ]],
  users: map(always(userSpec)),
}

we can easily validate the children individual properties such as firstName, lastName

but in order to find the duplicates between each users.one.firstName, users.two.firstName, etc child we need the actual users object to compare each child

the only thing i can think of is maybe updating the validationRules for users to pre-process the input and then pass the function to merge with the existing userSpec

dont know if anyone else had a similar experience so i thought i would ask

cheers

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
davidchasecommented, May 28, 2018

@busypeoples cool sounds good, let me know what you come up with 😃

1reaction
busypeoplescommented, Apr 21, 2018

Hi! Thanks for the feedback! Will look into this, either today or tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Questions to Ask Your Kids About Their Relationship With ...
1. What is causing you the most stress with your parents? · 2. Do you have a regular time that you and your...
Read more >
Relationship Building Questions To Ask Kids (With Printable!)
These are excellent questions to ask kids to help them open up, learn more about each other, and really build the parent child...
Read more >
30 Questions To Ask Your Parents for a Better Relationship
Psychologists say questions to ask your parents to get to know them as people (rather than as just parents) can help strengthen your...
Read more >
Parent-Child Relations - Science topic - ResearchGate
Parent-Child Relations are the interactions between parent and child. What is this study about? The purpose of this study is to understand possible...
Read more >
Parent-Child Relationship Survey (PCRS)
Parent-Child Relationship Survey (PCRS) · 1. How much time do you feel you spend with your mother/father? (1 = almost none‚ 7 =...
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