mirror of
https://github.com/dzeiocom/libs.git
synced 2025-07-25 14:29:51 +00:00
fix(object-util): objectGet with an empty path throwing the incorrect error
Signed-off-by: Avior <git@avior.me>
This commit is contained in:
@ -509,4 +509,13 @@ describe('object get', () => {
|
||||
expect(objectGet({a: { b: [{ c: 'pouet' }]}}, 'a.c.0'))
|
||||
.toEqual(undefined)
|
||||
})
|
||||
|
||||
it('object get should return undefined', () => {
|
||||
expect(() => {
|
||||
objectGet({a: { b: [{ c: 'pouet' }]}}, [])
|
||||
}).toThrow()
|
||||
expect(() => {
|
||||
objectGet({a: { b: [{ c: 'pouet' }]}}, '')
|
||||
}).toThrow()
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user