Closed kanongil closed 3 years ago
Use method with nullOverride and shallow:
nullOverride
shallow
const defaults = { host: "localhost", port: 8000 }; const source = { host: null, port: 8080 }; Hoek.applyToDefaults(defaults, source, { nullOverride: true }); // Works - results in { host: null, port: 8080 } Hoek.applyToDefaults(defaults, source, { nullOverride: true, shallow: [] }); // Fails - results in { host: "localhost", port: 8080 }
Any shallow changes the result when nullOverride: true.
nullOverride: true
Always respect nullOverride: true.
Support plan
Context
What are you trying to achieve or the steps to reproduce?
Use method with
nullOverride
andshallow
:What was the result you got?
Any
shallow
changes the result whennullOverride: true
.What result did you expect?
Always respect
nullOverride: true
.