Add ignoreUndefined flag for rename()#616
Conversation
test/object.js
Outdated
There was a problem hiding this comment.
isn't it easier to do expect(value).to.deep.equal({ a: 'something' })?
There was a problem hiding this comment.
That's right, I just copied/paste https://github.com/JbIPS/joi/blob/master/test/object.js#L652.
If you think deep.equal() is better, I'll change it
There was a problem hiding this comment.
it will make sure that if you tamper with the test and add an extra key or something the test itself will still want to same result. in your case the results needs to have key a but it can aswell have key b. I don't think it is a major thing but it also improves readability imo
|
👍 |
lib/object.js
Outdated
|
To avoid future regressions can you also add tests combining this flag with override true ? And also add that flag to the docs. Thanks ! |
|
Added a cross test with |
|
nice work! |
Add ignoreUndefined flag for rename()
|
Thanks ! |
|
Thanks! Just one little question, when do you think this will be released? Just to know when I could go back to "joi": "6.1.0" on my package :) |
|
Finishing the work on IP validation then |
|
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions. |
Add a flag to ignore a missing key when renaming it.
close #614