fix(sample-gen): respect null values in examples (via #4679)

* improvement: re-enable and improve Models jump-to-path

* fix(sample-gen): respect null values in examples
This commit is contained in:
kyle
2018-06-27 19:40:00 -07:00
committed by GitHub
parent a86fcf312a
commit 9d02a7d8ad
3 changed files with 42 additions and 1 deletions

View File

@@ -742,7 +742,7 @@ export const getCommonExtensions = (defObj) => defObj.filter((v, k) => /^pattern
// `predicate` can be used to discriminate the stripping further,
// by preserving the key's place in the object based on its value.
export function deeplyStripKey(input, keyToStrip, predicate = () => true) {
if(typeof input !== "object" || Array.isArray(input) || !keyToStrip) {
if(typeof input !== "object" || Array.isArray(input) || input === null || !keyToStrip) {
return input
}