Skip to content

Commit

Permalink
feat(countNestedProperties): Handle null array when counting object p…
Browse files Browse the repository at this point in the history
…roperties
  • Loading branch information
matthieu.comby authored and Raphaël Benitte committed Jul 4, 2017
1 parent 91b894b commit 706011f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const _ = require('lodash')
exports.countNestedProperties = object => {
let propertiesCount = 0
Object.keys(object).forEach(key => {
if (object[key] != null && typeof object[key] === 'object') {
if (!_.isEmpty(object[key]) && typeof object[key] === 'object') {
const count = exports.countNestedProperties(object[key])
propertiesCount += count
} else {
Expand Down

0 comments on commit 706011f

Please sign in to comment.