Skip to content

Commit

Permalink
update dig to return immediately if object passed in is null
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Nov 7, 2023
1 parent faf14bd commit b7d0f61
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/helpers/dig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

module.exports = (object, path) => {
if (object == null) return
const paths = path.split('.')
let result = object
for (let i = 0, len = paths.length; i < len; i++) {
Expand Down

0 comments on commit b7d0f61

Please sign in to comment.