diff --git a/packages/gatsby/src/utils/sanitize-node.js b/packages/gatsby/src/utils/sanitize-node.js index 43cdb19376a54..f9231abba04dc 100644 --- a/packages/gatsby/src/utils/sanitize-node.js +++ b/packages/gatsby/src/utils/sanitize-node.js @@ -15,7 +15,7 @@ const sanitizeNode = (data, isNode = true, path = new Set()) => { const returnData = isPlainObject ? {} : [] let anyFieldChanged = false - _.each(data, (o, key) => { + _.forOwn(data, (o, key) => { if (isNode && key === `internal`) { returnData[key] = o return