Skip to content

Commit

Permalink
♻️ Put TypeError for empty path in nav
Browse files Browse the repository at this point in the history
  • Loading branch information
nlepage committed May 30, 2018
1 parent 53fc488 commit 3fa0bd2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/immutadot/src/nav/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { propsNav } from './propsNav'
import { sliceNav } from './sliceNav'

export function nav(path) {
if (path.length === 0) throw new TypeError('path should not be empty')

return path.reduceRight((next, [type, value]) => toNav(type)(value, next), finalNav)
}

Expand Down

0 comments on commit 3fa0bd2

Please sign in to comment.