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.

Option to clone a body

See original GitHub issue

There should be an option to clone a body and mutate it without mutating the old body. Something like this:

// {"size":2}
const a = bodybuilder()
  .size(2);

// {"size":2,"from":1}
bodybuilder(a.build())
  .from(1)
  .build();

In this example a should still only contain size. I think the new argument in bodybuilder should be a json string an not a bodybuilder instance because this would support hardcoded jsons too.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
danpazcommented, Nov 25, 2019

I think the new argument in bodybuilder should be a json string an not a bodybuilder instance because this would support hardcoded jsons too.

I don’t think it would be straightforward to produce a bodybuilder instance from JSON, especially with multiple levels of nesting. The only option I see is to clone the bodybuilder instance as shown above.

0reactions
johannes-scharlachcommented, Nov 27, 2019

Thanks, I just noticed. Great job!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handout 2 - Human Cloning Process
Organ Replacement: If vital organs of the human body can be cloned, they can serve as backup ... Cloning can serve as an...
Read more >
The Human Clone Market - PMC - NCBI
A few years from now, those who can afford it will contract cloning labs to grow clones to supply duplicate organs or replace...
Read more >
Cloning humans? Biological, ethical, and social considerations
First, the genetic information in the egg of a female is removed or neutralized. Somatic (i.e., body) cells are taken from the individual...
Read more >
What If You Cloned Your Body? - YouTube
Would you want to create a better version of yourself?With all the work to do, people to see, traffic jams to get stuck...
Read more >
Cloning - MedlinePlus
Cloning describes the processes used to create an exact genetic replica of another cell, tissue or organism. The copied material, which has ...
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